- Memory optimizations (see #166)
- This is now internal API and will no longer be documented in the changelog.
BuildStruct
is no longer necessary and was removed.
- Handle MySQL
time.Time
types by convertingtime.Time
usinggithub.com/go-sql-driver/mysql.NullTime
.DATE
/DATETIME
are returned as formatted strings.
- Pointer scanners are no longer allowed to handle
nil
, are forcefully set tonil
instead.
- Removed
Scanner.Interface()
: this should never have been exposed and wouldn't work the way you would expect it to. Instead, you can only copy to an existingreflect.Value
.
- Using
sql:",json"
on a struct field will (de)serialize it into JSON usingjson.Marshal
/json.Unmarshal
. - Using
sql:",binary"
on a struct field will attempt to (de)serialize it into binary usingencoding.BinaryMarshaler
/encoding.BinaryUnmarshaler
- also respectsMarshal
/Unmarshal
methods (works with gogo/protobuf) - Using
sql:",string"
on a struct field will attempt to (de)serialize it into a string usingencoding.TextMarshaler
/encoding.TextUnmarshaler
- Respect
sql.Scanner
anddriver.Valuer
interfaces the same way the sql package would.
- Automatic inference of sql types from struct field types:
- all sub-types of bool (eg:
type foo bool
) are coerced intobool
. - all sub-types of string (eg:
type foo string
) are coerced intostring
. int
/int8
/int16
/int32
/int64
/uint
/uint8
/uint16
/uint32
/uint64
and all sub-types (eg:type foo int16
) are coerced intoint64
.float32
/float64
and all sub-types (eg:type foo float32
) are coerced intofloat64
.
- all sub-types of bool (eg:
- Removed manual registration of types:
MustRegisterCustomScalar
RegisterCustomScalar
MustRegisterSimpleScalar
RegisterSimpleScalar
First entry