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

Function TestPoolQueryRow

pgxpool/pool_test.go:803–819  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

801}
802
803func TestPoolQueryRow(t *testing.T) {
804 t.Parallel()
805
806 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
807 defer cancel()
808
809 pool, err := pgxpool.New(ctx, os.Getenv("PGX_TEST_DATABASE"))
810 require.NoError(t, err)
811 defer pool.Close()
812
813 testQueryRow(t, ctx, pool)
814 waitForReleaseToComplete()
815
816 stats := pool.Stat()
817 assert.EqualValues(t, 0, stats.AcquiredConns())
818 assert.EqualValues(t, 1, stats.TotalConns())
819}
820
821// https://github.com/jackc/pgx/issues/677
822func TestPoolQueryRowErrNoRows(t *testing.T) {

Callers

nothing calls this directly

Calls 7

NewFunction · 0.92
testQueryRowFunction · 0.85
waitForReleaseToCompleteFunction · 0.85
StatMethod · 0.80
AcquiredConnsMethod · 0.80
TotalConnsMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected