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

Function TestRowScanner

rows_test.go:28–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestRowScanner(t *testing.T) {
29 t.Parallel()
30
31 defaultConnTestRunner.RunTest(context.Background(), t, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
32 var s testRowScanner
33 err := conn.QueryRow(ctx, "select 'Adam' as name, 72 as height").Scan(&s)
34 require.NoError(t, err)
35 require.Equal(t, "Adam", s.name)
36 require.Equal(t, int32(72), s.age)
37 })
38}
39
40type testErrRowScanner string
41

Callers

nothing calls this directly

Calls 3

RunTestMethod · 0.80
ScanMethod · 0.65
QueryRowMethod · 0.65

Tested by

no test coverage detected