(t *testing.T)
| 518 | } |
| 519 | |
| 520 | func TestConnQueryScanRange(t *testing.T) { |
| 521 | testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) { |
| 522 | skipCockroachDB(t, db, "Server does not support int4range") |
| 523 | |
| 524 | m := pgtype.NewMap() |
| 525 | |
| 526 | var r pgtype.Range[pgtype.Int4] |
| 527 | err := db.QueryRow("select int4range(1, 5)").Scan(m.SQLScanner(&r)) |
| 528 | require.NoError(t, err) |
| 529 | assert.Equal( |
| 530 | t, |
| 531 | pgtype.Range[pgtype.Int4]{ |
| 532 | Lower: pgtype.Int4{Int32: 1, Valid: true}, |
| 533 | Upper: pgtype.Int4{Int32: 5, Valid: true}, |
| 534 | LowerType: pgtype.Inclusive, |
| 535 | UpperType: pgtype.Exclusive, |
| 536 | Valid: true, |
| 537 | }, |
| 538 | r) |
| 539 | }) |
| 540 | } |
| 541 | |
| 542 | // Test type that pgx would handle natively in binary, but since it is not a |
| 543 | // database/sql native type should be passed through as a string |
nothing calls this directly
no test coverage detected