Add QRM error if result set is empty when scanning into struct destination.

This commit is contained in:
go-jet 2019-10-10 16:09:44 +02:00
parent 02fafd8a7a
commit 8c9ae77cd8
6 changed files with 61 additions and 22 deletions

View file

@ -38,7 +38,7 @@ func Query(ctx context.Context, db DB, query string, args []interface{}, destPtr
}
if tempSliceValue.Len() == 0 {
return nil
return sql.ErrNoRows
}
structValue := reflect.ValueOf(destPtr).Elem()