pgtest

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(t testing.TB, conn *pgx.Conn)

Close safely closes a database connection

func Connect

func Connect(ctx context.Context, t testing.TB) *pgx.Conn

Connect creates a new database connection for testing

func ParseConfig

func ParseConfig(t testing.TB) *pgx.ConnConfig

ParseConfig returns a test connection config with logging

func WithConn

func WithConn(t testing.TB, fn func(*pgx.Conn))

WithConn provides a database connection to a test function and handles cleanup

Types

type TestDB

type TestDB struct {
	Config *pgx.ConnConfig
}

TestDB encapsulates test database functionality

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL