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

Function TestConnQueryRowByteSlice

stdlib/sql_test.go:464–473  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

462}
463
464func TestConnQueryRowByteSlice(t *testing.T) {
465 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
466 expected := []byte{222, 173, 190, 239}
467 var actual []byte
468
469 err := db.QueryRow(`select E'\\xdeadbeef'::bytea`).Scan(&actual)
470 require.NoError(t, err)
471 require.EqualValues(t, expected, actual)
472 })
473}
474
475func TestConnQueryFailure(t *testing.T) {
476 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