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

Function TestTxQuery

pgxpool/tx_test.go:30–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestTxQuery(t *testing.T) {
31 t.Parallel()
32
33 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
34 defer cancel()
35
36 pool, err := pgxpool.New(ctx, os.Getenv("PGX_TEST_DATABASE"))
37 require.NoError(t, err)
38 defer pool.Close()
39
40 tx, err := pool.Begin(ctx)
41 require.NoError(t, err)
42 defer tx.Rollback(ctx)
43
44 testQuery(t, ctx, tx)
45}
46
47func TestTxQueryRow(t *testing.T) {
48 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
testQueryFunction · 0.85
CloseMethod · 0.65
BeginMethod · 0.65
RollbackMethod · 0.65

Tested by

no test coverage detected