Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseManager ¶
type BaseManager struct {
// contains filtered or unexported fields
}
BaseManager provides common schema management functionality
func NewBaseManager ¶
func NewBaseManager() *BaseManager
NewBaseManager creates a new base schema manager
func (*BaseManager) EnsureVersionTable ¶
EnsureVersionTable creates the schema version table if it doesn't exist
func (*BaseManager) GetVersion ¶
GetVersion retrieves the current schema version
func (*BaseManager) SetVersion ¶
func (m *BaseManager) SetVersion(ctx context.Context, db *sql.DB, version uint, description string) error
SetVersion records a new schema version
type Manager ¶
type Manager interface {
// Initialize creates the initial schema if it doesn't exist
Initialize(ctx context.Context, db *sql.DB) error
// Migrate runs migrations to bring schema to target version
Migrate(ctx context.Context, db *sql.DB, targetVersion uint) error
// Version returns the current schema version
Version(ctx context.Context, db *sql.DB) (uint, bool, error)
// Validate checks that the schema is in a valid state
Validate(ctx context.Context, db *sql.DB) error
}
Manager handles schema initialization and migrations for SQL storage backends. Each backend (SQLite, Postgres) implements this interface.
Click to show internal directories.
Click to hide internal directories.