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"
"io"
)
@@ -43,3 +44,13 @@ func (src OidValue) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
func (src OidValue) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
return (pguint32)(src).EncodeBinary(ci, w)
}
// Scan implements the database/sql Scanner interface.
func (dst *OidValue) Scan(src interface{}) error {
return (*pguint32)(dst).Scan(src)
}
// Value implements the database/sql/driver Valuer interface.
func (src OidValue) Value() (driver.Value, error) {
return (pguint32)(src).Value()
}