2
0

Add database/sql support to pgtype

This commit is contained in:
Jack Christensen
2017-03-18 21:11:43 -05:00
parent 3acd3d8546
commit 6f9ef694d0
51 changed files with 1398 additions and 51 deletions
+11
View File
@@ -1,6 +1,7 @@
package pgtype
import (
"database/sql/driver"
"io"
)
@@ -27,3 +28,13 @@ func (dst *GenericBinary) DecodeBinary(ci *ConnInfo, src []byte) error {
func (src GenericBinary) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
return (Bytea)(src).EncodeBinary(ci, w)
}
// Scan implements the database/sql Scanner interface.
func (dst *GenericBinary) Scan(src interface{}) error {
return (*Bytea)(dst).Scan(src)
}
// Value implements the database/sql/driver Valuer interface.
func (src GenericBinary) Value() (driver.Value, error) {
return (Bytea)(src).Value()
}