2
0

Add PgxScanner interface

Enables types to support database/sql at the same time as pgx.

fixes #232
This commit is contained in:
Jack Christensen
2017-02-02 20:20:31 -06:00
parent 63e482f6bc
commit a52a6bd555
6 changed files with 90 additions and 7 deletions
+5
View File
@@ -264,6 +264,11 @@ func (rows *Rows) Scan(dest ...interface{}) (err error) {
if err != nil {
rows.Fatal(scanArgError{col: i, err: err})
}
} else if s, ok := d.(PgxScanner); ok {
err = s.ScanPgx(vr)
if err != nil {
rows.Fatal(scanArgError{col: i, err: err})
}
} else if s, ok := d.(sql.Scanner); ok {
var val interface{}
if 0 <= vr.Len() {