aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/driver/driver.go
diff options
context:
space:
mode:
authorDaniel Theophanes <kardianos@gmail.com>2016-11-23 09:10:30 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2016-12-01 16:52:12 +0000
commite5e05627745764fb9989bf3966919d6715f21abc (patch)
treea504ad49f44371aab7d2b62eeb92108e6470df5d /src/database/sql/driver/driver.go
parentea1b90f855fe2891ff0f39d3a3f4b0a5f72a04ed (diff)
downloadgo-e5e05627745764fb9989bf3966919d6715f21abc.tar.xz
database/sql: document expectations for named parameters
Require parameter names to not begin with a symbol. Change-Id: I5dfe9d4e181f0daf71dad2f395aca41c68678cbe Reviewed-on: https://go-review.googlesource.com/33493 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/database/sql/driver/driver.go')
-rw-r--r--src/database/sql/driver/driver.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/database/sql/driver/driver.go b/src/database/sql/driver/driver.go
index c8cbbf0696..2e47cd9ee7 100644
--- a/src/database/sql/driver/driver.go
+++ b/src/database/sql/driver/driver.go
@@ -27,13 +27,18 @@ import (
type Value interface{}
// NamedValue holds both the value name and value.
-// The Ordinal is the position of the parameter starting from one and is always set.
-// If the Name is not empty it should be used for the parameter identifier and
-// not the ordinal position.
type NamedValue struct {
- Name string
+ // If the Name is not empty it should be used for the parameter identifier and
+ // not the ordinal position.
+ //
+ // Name will not have a symbol prefix.
+ Name string
+
+ // Ordinal position of the parameter starting from one and is always set.
Ordinal int
- Value Value
+
+ // Value is the parameter value.
+ Value Value
}
// Driver is the interface that must be implemented by a database