mirror of https://github.com/go-gorm/gorm.git
Allow to support other field types
This commit is contained in:
parent
109f239fae
commit
4f6291154b
|
@ -84,7 +84,10 @@ func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value,
|
||||||
case string:
|
case string:
|
||||||
bytes = []byte(v)
|
bytes = []byte(v)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("failed to unmarshal JSONB value: %#v", dbValue)
|
bytes, err = json.Marshal(v)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(bytes) > 0 {
|
if len(bytes) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue