schema/field: support valuescanner types for uuid fields (#1538)

Fixed #1485
This commit is contained in:
Ariel Mashraki
2021-05-07 16:22:46 +03:00
committed by GitHub
parent be59ad6d3f
commit 0bfaa11e2f
21 changed files with 499 additions and 15 deletions

View File

@@ -125,7 +125,7 @@ func Enum(name string) *enumBuilder {
//
func UUID(name string, typ driver.Valuer) *uuidBuilder {
rt := reflect.TypeOf(typ)
return &uuidBuilder{&Descriptor{
b := &uuidBuilder{&Descriptor{
Name: name,
Info: &TypeInfo{
Type: TypeUUID,
@@ -134,6 +134,8 @@ func UUID(name string, typ driver.Valuer) *uuidBuilder {
PkgPath: indirect(rt).PkgPath(),
},
}}
b.desc.goType(typ, valueScannerType)
return b
}
// Other represents a field that is not a good fit for any of the standard field types.