Versions in this module Expand all Collapse all v1 v1.0.0 Oct 20, 2026 Changes in this version + func DefaultGuard(database string) bool + func Register(scheme string, d Dialect) + type Cleaner struct + func New(url string, opts ...Option) *Cleaner + func (c *Cleaner) CleanWith(ctx context.Context, s Strategy) error + func (c *Cleaner) Cleaning(ctx context.Context, fn func(db *sql.DB) error) error + func (c *Cleaner) Close() error + func (c *Cleaner) DB(t testing.TB) *sql.DB + func (c *Cleaner) Start(ctx context.Context) (*Session, error) + func (c *Cleaner) URL(ctx context.Context) (string, error) + type Deleter interface + Delete func(ctx context.Context, tx *sql.Tx, table string) error + type Dialect interface + CurrentDatabase func(ctx context.Context, db *sql.DB) (string, error) + Driver func() string + Quote func(identifier string) string + References func(ctx context.Context, db *sql.DB) (map[string][]string, error) + Tables func(ctx context.Context, db *sql.DB) ([]string, error) + Truncate func(ctx context.Context, db *sql.DB, tables []string) error + type Leaser interface + Lease func(ctx context.Context, rawURL, driver, version string, ...) (leased string, release func() error, err error) + type Option func(*Cleaner) + func WithDialect(d Dialect) Option + func WithDriver(name string) Option + func WithGuard(allow func(database string) bool) Option + func WithSetup(fn func(ctx context.Context, db *sql.DB) error) Option + func WithStrategy(s Strategy) Option + func WithTemplate(version string, build func(ctx context.Context, db *sql.DB, url string) error) Option + type Session struct + func (s *Session) Clean(ctx context.Context) error + func (s *Session) DB() *sql.DB + type Strategy interface + func Deletion(opts ...TableOption) Strategy + func Null() Strategy + func Transaction() Strategy + func Truncation(opts ...TableOption) Strategy + type TableOption func(*filter) + func Except(tables ...string) TableOption + func Only(tables ...string) TableOption