Versions in this module Expand all Collapse all v0 v0.1.0 Oct 22, 2026 Changes in this version + const AdminDSNEnv + const DefaultAdminDSN + func HashFiles(paths ...string) (string, error) + func New(t testing.TB, initializer testdb.DBInitializer, opts ...testdb.Option) *testdb.TestDatabase + func Setup(t testing.TB, opts ...testdb.Option) *pgxpool.Pool + func TemplateExists(ctx context.Context, name string, opts ...TemplateOption) (bool, error) + type PoolInitializer struct + ConfigModifier func(*pgxpool.Config) + func (pi *PoolInitializer) InitializeTestDatabase(ctx context.Context, dsn string) (any, error) + type PostgresProvider struct + func (p *PostgresProvider) BuildDSN(dbName string) (string, error) + func (p *PostgresProvider) Cleanup(ctx context.Context) error + func (p *PostgresProvider) CreateDatabase(ctx context.Context, name string) error + func (p *PostgresProvider) CreateDatabaseFromTemplate(ctx context.Context, name, templateName string) (string, error) + func (p *PostgresProvider) DropDatabase(ctx context.Context, name string) error + func (p *PostgresProvider) Initialize(ctx context.Context, cfg testdb.Config) error + func (p *PostgresProvider) InspectCommand(dsn string) string + func (p *PostgresProvider) ResolvedAdminDSN() string + func (p *PostgresProvider) TemplateExists(ctx context.Context, name string) (bool, error) + func (p *PostgresProvider) TerminateConnections(ctx context.Context, name string) error + type SetupFunc = testdb.MigratorFunc + func Compose(setupFuncs ...SetupFunc) SetupFunc + func LoadSQLFile(path string) SetupFunc + func SQLFiles(dir string) SetupFunc + type SqlDbInitializer struct + func (si *SqlDbInitializer) InitializeTestDatabase(ctx context.Context, dsn string) (any, error) + type Template struct + func EnsureTemplate(ctx context.Context, name string, setup SetupFunc, opts ...TemplateOption) (*Template, error) + func (t *Template) Name() string + func (t *Template) Option() testdb.Option + func (t *Template) Release(ctx context.Context) error + type TemplateOption func(*templateConfig) + func WithFingerprint(fingerprint string) TemplateOption + func WithKeepTemplate() TemplateOption + func WithTemplateAdminDSN(dsn string) TemplateOption