2
0

Add database/sql support to pgtype

This commit is contained in:
Jack Christensen
2017-03-18 21:11:43 -05:00
parent 5572c002dc
commit bec9bd261b
55 changed files with 1459 additions and 201 deletions
+11
View File
@@ -1,6 +1,7 @@
package pgtype
import (
"database/sql/driver"
"fmt"
"io"
)
@@ -66,3 +67,13 @@ func (src Jsonb) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
_, err = w.Write(src.Bytes)
return false, err
}
// Scan implements the database/sql Scanner interface.
func (dst *Jsonb) Scan(src interface{}) error {
return (*Json)(dst).Scan(src)
}
// Value implements the database/sql/driver Valuer interface.
func (src Jsonb) Value() (driver.Value, error) {
return (Json)(src).Value()
}