Fix scanning int into **sql.Scanner implementor
See https://github.com/jackc/pgx/issues/897.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package pgtype
|
package pgtype
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"database/sql"
|
||||||
"math"
|
"math"
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
@@ -277,6 +278,8 @@ func int64AssignTo(srcVal int64, srcStatus Status, dst interface{}) error {
|
|||||||
return errors.Errorf("%d is less than zero for uint64", srcVal)
|
return errors.Errorf("%d is less than zero for uint64", srcVal)
|
||||||
}
|
}
|
||||||
*v = uint64(srcVal)
|
*v = uint64(srcVal)
|
||||||
|
case sql.Scanner:
|
||||||
|
return v.Scan(srcVal)
|
||||||
default:
|
default:
|
||||||
if v := reflect.ValueOf(dst); v.Kind() == reflect.Ptr {
|
if v := reflect.ValueOf(dst); v.Kind() == reflect.Ptr {
|
||||||
el := v.Elem()
|
el := v.Elem()
|
||||||
|
|||||||
Reference in New Issue
Block a user