MCPcopy Create free account
hub / github.com/egonelbre/exp / WithDatabase

Function WithDatabase

schema/database_test.go:71–76  ·  view source on GitHub ↗
(ctx context.Context, tb TB, fn func(t TB, db *pgx.Conn))

Source from the content-addressed store, hash-verified

69}
70
71func WithDatabase[TB testing.TB](ctx context.Context, tb TB, fn func(t TB, db *pgx.Conn)) {
72 if *pgaddr == "" {
73 tb.Skip("-database flag not defined")
74 }
75 withDatabase(ctx, *pgaddr, tb, fn)
76}
77
78func withDatabase[TB testing.TB](ctx context.Context, connstr string, tb TB, fn func(t TB, db *pgx.Conn)) {
79 if connstr == "" {

Callers

nothing calls this directly

Calls 1

withDatabaseFunction · 0.85

Tested by

no test coverage detected