MCPcopy
hub / github.com/jackc/pgx / TestConnQueryRowPgxBinary

Function TestConnQueryRowPgxBinary

stdlib/sql_test.go:544–554  ·  view source on GitHub ↗

Test type that pgx would handle natively in binary, but since it is not a database/sql native type should be passed through as a string

(t *testing.T)

Source from the content-addressed store, hash-verified

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
544func TestConnQueryRowPgxBinary(t *testing.T) {
545 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
546 sql := "select $1::int4[]"
547 expected := "{1,2,3}"
548 var actual string
549
550 err := db.QueryRow(sql, expected).Scan(&actual)
551 require.NoError(t, err)
552 require.EqualValues(t, expected, actual)
553 })
554}
555
556func TestConnQueryRowUnknownType(t *testing.T) {
557 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {

Callers

nothing calls this directly

Calls 3

ScanMethod · 0.65
QueryRowMethod · 0.65

Tested by

no test coverage detected