Versions in this module Expand all Collapse all v0 v0.1.0 Oct 22, 2026 Changes in this version + const AdminDSNEnv + const DefaultAdminDSN + func LoadSQLFile(path string) testdb.MigratorFunc + func New(t testing.TB, initializer testdb.DBInitializer, opts ...testdb.Option) *testdb.TestDatabase + func SQLFiles(dir string) testdb.MigratorFunc + func Setup(t testing.TB, opts ...testdb.Option) *sql.DB + func TemplateExists(ctx context.Context, name string, opts ...TemplateOption) (bool, error) + type Provider struct + func (p *Provider) BuildDSN(dbName string) (string, error) + func (p *Provider) Cleanup(ctx context.Context) error + func (p *Provider) CreateDatabase(ctx context.Context, name string) error + func (p *Provider) CreateDatabaseFromTemplate(ctx context.Context, requestedName, templateName string) (string, error) + func (p *Provider) DropDatabase(ctx context.Context, name string) error + func (p *Provider) Initialize(ctx context.Context, cfg testdb.Config) error + func (p *Provider) InspectCommand(dsn string) string + func (p *Provider) ResolvedAdminDSN() string + func (p *Provider) TemplateExists(ctx context.Context, name string) (bool, error) + func (p *Provider) TerminateConnections(ctx context.Context, name string) error + type SQLDBInitializer struct + ConfigModifier func(*sql.DB) + func (i *SQLDBInitializer) InitializeTestDatabase(ctx context.Context, dsn string) (any, error) + type SetupFunc = testdb.MigratorFunc + 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) Ready() int + func (t *Template) Release(ctx context.Context) error + type TemplateOption func(*templateConfig) + func WithFingerprint(fingerprint string) TemplateOption + func WithKeepTemplate() TemplateOption + func WithReadyDatabases(n int) TemplateOption + func WithReadyPrefix(prefix string) TemplateOption + func WithReadyWarmup(on bool) TemplateOption + func WithReadyWorkers(n int) TemplateOption + func WithTemplateAdminDSN(dsn string) TemplateOption