Automatically register Array and FlatArray
This commit is contained in:
+12
-1
@@ -374,7 +374,7 @@ func TestConnSimpleSlicePassThrough(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestConnQueryScanArray(t *testing.T) {
|
||||
func TestConnQueryScanGoArray(t *testing.T) {
|
||||
testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
|
||||
m := pgtype.NewMap()
|
||||
|
||||
@@ -385,6 +385,17 @@ func TestConnQueryScanArray(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestConnQueryScanArray(t *testing.T) {
|
||||
testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
|
||||
m := pgtype.NewMap()
|
||||
|
||||
var a pgtype.Array[int64]
|
||||
err := db.QueryRow("select '{1,2,3}'::bigint[]").Scan(m.SQLScanner(&a))
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, pgtype.Array[int64]{Elements: []int64{1, 2, 3}, Dims: []pgtype.ArrayDimension{{Length: 3, LowerBound: 1}}, Valid: true}, a)
|
||||
})
|
||||
}
|
||||
|
||||
func TestConnQueryScanRange(t *testing.T) {
|
||||
testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
|
||||
m := pgtype.NewMap()
|
||||
|
||||
Reference in New Issue
Block a user