Documentation
¶
Overview ¶
Package dbmig applies forward-only SQLite schema migrations.
Apply works with database/sql so callers own SQLite connection setup. The cr ledger startup path should still enforce its own connection contract, including single-writer behavior or db.SetMaxOpenConns(1).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidPlan means the compiled migration list is internally // inconsistent and should be fixed in code before opening user data. ErrInvalidPlan = errors.New("dbmig: invalid migration plan") // ErrInvalidMeta means durable schema metadata is malformed; callers should // fail loudly rather than trying to repair it implicitly. ErrInvalidMeta = errors.New("dbmig: invalid meta state") // ErrDowngrade means the database schema is newer than this binary knows how // to operate. ErrDowngrade = errors.New("dbmig: database schema newer than code") )
Functions ¶
This section is empty.
Types ¶
type AppliedMigration ¶
AppliedMigration records a migration that ran during Apply.
type Result ¶
type Result struct {
PreviousVersion int
CurrentVersion int
Applied []AppliedMigration
}
Result summarizes one Apply invocation.
Click to show internal directories.
Click to hide internal directories.