Documentation
¶
Overview ¶
Package sqlbase provides the base functionality for SQL database persistence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrationManager ¶
type MigrationManager struct {
// contains filtered or unexported fields
}
MigrationManager handles database schema migrations.
func NewMigrationManager ¶
func NewMigrationManager(logger *slog.Logger, db *sql.DB, migrations map[int]string) *MigrationManager
NewMigrationManager creates a new migration manager.
func (*MigrationManager) RunMigrations ¶
func (m *MigrationManager) RunMigrations(ctx context.Context) error
RunMigrations applies, in version order, every migration not yet recorded in schema_migrations. It holds a Postgres advisory lock for the whole run, so replicas starting together apply each migration once.
Click to show internal directories.
Click to hide internal directories.