Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlbase

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL