You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs are a bit confusing. A few suggested simplifications.
First, introduce type Value interface{} to represent (even if not
compiler-checked) the driver "subset" values (also avoid the
word subset).
// A driver Value is a value that drivers must be able to handle.
// A Value is either nil or an instance of one of these types:
// int64
// float64
// ...
type Value interface{}
and use Value where that is what is meant.
// IsValue reports whether v is a driver Value.
func IsValue(v interface{}) bool
(old IsParameterSubsetType)
// IsScanValue reports whether v is an appropriate driver Value
// for use in Scan. This is any driver Value except strings.
func IsScanValue(v interface{}) bool
(old IsScanSubsetType)
// Data can control how it is converted to Value by
// implementing the Value method.
type Valuer interface {
Value() (Value, error)
}
(old SubsetValuer)
The ValueConverter interface is not getting anything from
its receiver, and it introduces an extra level that is confusing.
Suggest making it a function
// A Converter converts any value into a driver Value.
type Converter func(interface{}) (Value, error)
(old ValueConverter)
Other issues:
"DDL" is mentioned in the docs but not defined (probably remove it, don't
define it).
Address the TODO in driver.Stmt's Close comment one way or another.
The text was updated successfully, but these errors were encountered:
CL here:
http://golang.org/cl/5674084/
Not done:
-- Converter func: the Null and NotNull types use the receiver. Still thinking.
-- DDL: Anybody writing a driver would know these I think, and find them convenient to
return? Don't feel really strongly, though.
The text was updated successfully, but these errors were encountered: