pgtype.JSON(B).Value now returns []byte
Allows scanning jsonb column into *json.RawMessage. fixes #409
This commit is contained in:
@@ -152,7 +152,7 @@ func (dst *JSON) Scan(src interface{}) error {
|
|||||||
func (src *JSON) Value() (driver.Value, error) {
|
func (src *JSON) Value() (driver.Value, error) {
|
||||||
switch src.Status {
|
switch src.Status {
|
||||||
case Present:
|
case Present:
|
||||||
return string(src.Bytes), nil
|
return src.Bytes, nil
|
||||||
case Null:
|
case Null:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user