Versions in this module Expand all Collapse all v1 v1.15.1 Jun 9, 2025 Changes in this version + func Migrate(ctx context.Context, db DatabaseConn, opts MigrationOptions) (err error) + type DatabaseConn interface + Begin func(context.Context) (databaseConnTx, error) + Exec func(context.Context, string, ...any) (int64, error) + IsNoRowsError func(err error) bool + QueryRow func(context.Context, string, ...any) databaseConnRow + func AdaptDatabaseSQLConn(db DatabaseSQLConn) DatabaseConn + func AdaptPgxConn(db PgxConn) DatabaseConn + type DatabaseSQLAdapter struct + func (sqla *DatabaseSQLAdapter) Begin(ctx context.Context) (databaseConnTx, error) + func (sqla *DatabaseSQLAdapter) Exec(ctx context.Context, query string, args ...any) (int64, error) + func (sqla *DatabaseSQLAdapter) IsNoRowsError(err error) bool + func (sqla *DatabaseSQLAdapter) QueryRow(ctx context.Context, query string, args ...any) databaseConnRow + type DatabaseSQLConn interface + BeginTx func(context.Context, *sql.TxOptions) (*sql.Tx, error) + ExecContext func(context.Context, string, ...any) (sql.Result, error) + QueryContext func(context.Context, string, ...any) (*sql.Rows, error) + QueryRowContext func(context.Context, string, ...any) *sql.Row + type GCOptions struct + CleanupInterval time.Duration + DB DatabaseConn + DeleteExpiredValuesQuery string + Logger logger.Logger + UpdateLastCleanupQuery func(arg any) (string, any) + type GarbageCollector interface + CleanupExpired func() error + func ScheduleGarbageCollector(opts GCOptions) (GarbageCollector, error) + type MigrationFn = func(ctx context.Context) error + type MigrationOptions struct + EnsureMetadataTable func(ctx context.Context) error + GetVersionQuery string + Logger logger.Logger + Migrations []MigrationFn + UpdateVersionQuery func(version string) (string, any) + type MigrationTeardownFn = func() error + type PgxAdapter struct + func (pga *PgxAdapter) Begin(ctx context.Context) (databaseConnTx, error) + func (pga *PgxAdapter) Exec(ctx context.Context, query string, args ...any) (int64, error) + func (pga *PgxAdapter) IsNoRowsError(err error) bool + func (pga *PgxAdapter) QueryRow(ctx context.Context, query string, args ...any) databaseConnRow + type PgxConn interface + Begin func(context.Context) (pgx.Tx, error) + Exec func(context.Context, string, ...any) (pgconn.CommandTag, error) + Query func(context.Context, string, ...any) (pgx.Rows, error) + QueryRow func(context.Context, string, ...any) pgx.Row