(t *testing.T)
| 503 | } |
| 504 | |
| 505 | func TestConnQueryScanArray(t *testing.T) { |
| 506 | testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) { |
| 507 | m := pgtype.NewMap() |
| 508 | |
| 509 | var a pgtype.Array[int64] |
| 510 | err := db.QueryRow("select '{1,2,3}'::bigint[]").Scan(m.SQLScanner(&a)) |
| 511 | require.NoError(t, err) |
| 512 | assert.Equal(t, pgtype.Array[int64]{Elements: []int64{1, 2, 3}, Dims: []pgtype.ArrayDimension{{Length: 3, LowerBound: 1}}, Valid: true}, a) |
| 513 | |
| 514 | err = db.QueryRow("select null::bigint[]").Scan(m.SQLScanner(&a)) |
| 515 | require.NoError(t, err) |
| 516 | assert.Equal(t, pgtype.Array[int64]{Elements: nil, Dims: nil, Valid: false}, a) |
| 517 | }) |
| 518 | } |
| 519 | |
| 520 | func TestConnQueryScanRange(t *testing.T) { |
| 521 | testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) { |
nothing calls this directly
no test coverage detected