fix: scan more base type and sql.NullXXX (#3813)

This commit is contained in:
SmallTianTian 2020-12-02 14:00:16 +08:00 committed by GitHub
parent acedbb8310
commit 41e52f343a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -84,7 +84,12 @@ func Scan(rows *sql.Rows, db *DB, initialized bool) {
scanIntoMap(mapValue, values, columns) scanIntoMap(mapValue, values, columns)
*dest = append(*dest, mapValue) *dest = append(*dest, mapValue)
} }
case *int, *int32, *int64, *uint, *uint32, *uint64, *float32, *float64, *string, *time.Time: case *int, *int8, *int16, *int32, *int64,
*uint, *uint8, *uint16, *uint32, *uint64, *uintptr,
*float32, *float64,
*bool, *string, *time.Time,
*sql.NullInt32, *sql.NullInt64, *sql.NullFloat64,
*sql.NullBool, *sql.NullString, *sql.NullTime:
for initialized || rows.Next() { for initialized || rows.Next() {
initialized = false initialized = false
db.RowsAffected++ db.RowsAffected++