Documentation
¶
Index ¶
- func MigrateDownAll(migrationsFS fs.FS, databaseURL string) error
- func MigrationStatus(migrationsFS fs.FS, databaseURL string) (version uint, dirty bool, err error)
- func NewPool(ctx context.Context, cfg config.DatabaseConfig) (*pgxpool.Pool, error)
- func RunMigrations(migrationsFS fs.FS, databaseURL string) error
- func WithTx(ctx context.Context, pool *pgxpool.Pool, fn func(pgx.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateDownAll ¶
MigrateDownAll rolls back every applied migration. It is destructive and used only by the migration round-trip test and the guarded `legant migrate down` command — never in normal operation.
func MigrationStatus ¶
MigrationStatus reports the current migration version and dirty flag, for readiness checks. A dirty database is not ready to serve.
func RunMigrations ¶
RunMigrations applies all pending migrations. It refuses to proceed if the schema_migrations table is marked dirty (a prior migration failed mid-way), which must be resolved by an operator rather than silently retried.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.