Documentation
¶
Overview ¶
Package migrations loads immutable SQL histories, validates checksum-bound ledger state, and coordinates plans, execution, baselines and dirty recovery. Construct a Source and Backend, then use NewRunner for database operations; PlanUp, PlanDown and BuildStatus are database-independent validation helpers.
Each runner operation loads source before acquiring a backend session and validates that loaded history against the locked ledger. Callers must keep deployment sources immutable; the database lock does not freeze a filesystem. The runner borrows its dependencies, starts no goroutines and does not close the caller's database. Shared sources, backends and observers must support the concurrency with which callers invoke them.
SQL is trusted deployment code, not a sandboxed or authorized request. A checksum detects identity changes; it is neither a signature nor proof that SQL is safe or reversible. Recovery records an operator-reviewed assertion, not an automatic inspection or repair of database effects. See the owned v1 format in docs/migration-format.md and lifecycle in docs/operations.md.
Index ¶
- Constants
- Variables
- type Action
- type Backend
- type Baseline
- type Checksum
- type Event
- type FSSource
- type FSSourceOption
- type Migration
- type Observer
- type Operation
- type Option
- type Phase
- type Plan
- type Record
- type RecordKind
- type Recovery
- type RecoveryAction
- type RecoveryResult
- type Result
- type Runner
- func (runner *Runner) Baseline(ctx context.Context, baseline Baseline) (record Record, err error)
- func (runner *Runner) Down(ctx context.Context, count uint64) (result Result, err error)
- func (runner *Runner) Plan(ctx context.Context) (plan Plan, err error)
- func (runner *Runner) Recover(ctx context.Context, recovery Recovery) (result RecoveryResult, err error)
- func (runner *Runner) Status(ctx context.Context) (status Status, err error)
- func (runner *Runner) Up(ctx context.Context) (result Result, err error)
- type Session
- type Source
- type SourceDirectoryLimits
- type SourceEntry
- type SourceFileSystem
- type State
- type Status
- type StatusEntry
- type Step
- type TransactionMode
- type Version
Constants ¶
const ( // MaxMigrationFiles is the largest complete source inventory retained by // one load operation. MaxMigrationFiles = 4096 // MaxMigrationSourceRootBytes is the largest source root path accepted by // NewFSSource. MaxMigrationSourceRootBytes = 4096 // MaxMigrationSourceNameBytes bounds aggregate filename data returned by a // source directory operation. MaxMigrationSourceNameBytes = 1 << 20 // MaxMigrationSourceBytes bounds aggregate migration-file content read by // one load operation. MaxMigrationSourceBytes = 16 << 20 )
const MaxMigrationNameBytes = 255
MaxMigrationNameBytes is the largest canonical migration, baseline, or ledger-record name accepted by the public contracts.
const ( // MaxMigrationRecords is the largest complete ledger history accepted by // planning and status operations: one baseline plus MaxMigrationFiles. MaxMigrationRecords = MaxMigrationFiles + 1 )
Variables ¶
var ( // ErrInvalidBaseline indicates malformed reviewed baseline metadata. ErrInvalidBaseline = errors.New("invalid schema baseline") // ErrBaselineMismatch indicates live schema drift from the reviewed contract. ErrBaselineMismatch = errors.New("schema does not match reviewed baseline") // ErrBaselineExists indicates that owned migration history is not empty. ErrBaselineExists = errors.New("migration baseline already exists") // ErrBaselineVersionConflict indicates Go migrations at or below the // baseline cutoff. ErrBaselineVersionConflict = errors.New("go migration conflicts with baseline version") // ErrBaselineUnsupported indicates a backend without baseline conformance. ErrBaselineUnsupported = errors.New("migration backend does not support baselines") )
var ( // ErrInvalidVersion indicates that a migration version is zero or malformed. ErrInvalidVersion = errors.New("invalid migration version") // ErrInvalidName indicates that a migration name is not canonical snake case. ErrInvalidName = errors.New("invalid migration name") // ErrInvalidTransactionMode indicates an unknown transaction mode. ErrInvalidTransactionMode = errors.New("invalid transaction mode") // ErrEmptyUpSQL indicates that a migration has no forward operation. ErrEmptyUpSQL = errors.New("migration up SQL is empty") // ErrInvalidChecksum indicates malformed or unsupported checksum text. ErrInvalidChecksum = errors.New("invalid migration checksum") )
var ( // ErrInvalidRecord indicates malformed owned-ledger data. ErrInvalidRecord = errors.New("invalid migration record") // ErrHistoryLimit indicates source or ledger history beyond the public // planning and status retention budget. ErrHistoryLimit = errors.New("migration history limit exceeded") // ErrDirty indicates an interrupted or partially applied migration. ErrDirty = errors.New("dirty migration history") // ErrChecksumMismatch indicates an applied migration was modified. ErrChecksumMismatch = errors.New("migration checksum mismatch") // ErrRenamedMigration indicates an applied version now has another name. ErrRenamedMigration = errors.New("applied migration was renamed") // ErrDeletedMigration indicates an applied migration is absent from source. ErrDeletedMigration = errors.New("applied migration was deleted") // ErrReorderedHistory indicates non-monotonic or non-prefix history. ErrReorderedHistory = errors.New("migration history was reordered") // ErrInvalidTarget indicates an impossible or ambiguous plan target. ErrInvalidTarget = errors.New("invalid migration target") // ErrIrreversible indicates that rollback SQL was not provided. ErrIrreversible = errors.New("migration is irreversible") )
var ( // ErrInvalidRecovery indicates malformed recovery input. ErrInvalidRecovery = errors.New("invalid dirty migration recovery") // ErrRecoveryMismatch indicates that source identity differs from the // operator-reviewed recovery request. ErrRecoveryMismatch = errors.New("dirty migration recovery identity mismatch") // ErrNoDirtyMigration indicates there is no matching unresolved outcome. ErrNoDirtyMigration = errors.New("dirty migration not found") // ErrRecoveryUnsupported indicates a backend without recovery conformance. ErrRecoveryUnsupported = errors.New("migration backend does not support recovery") // ErrRecoveryConflict indicates more than one dirty migration in the ledger. ErrRecoveryConflict = errors.New("multiple dirty migrations require recovery") )
var ( // ErrInvalidRunner indicates missing or inconsistent runner dependencies. ErrInvalidRunner = errors.New("invalid migration runner") // ErrBackendResult indicates an engine violated the public backend contract. ErrBackendResult = errors.New("invalid migration backend result") // ErrExecutionFailed identifies migration SQL execution failure without // exposing database-driver diagnostics or migration contents. ErrExecutionFailed = errors.New("migration SQL execution failed") )
var ( // ErrInvalidSource indicates an unusable filesystem source configuration. ErrInvalidSource = errors.New("invalid migration source") // ErrInvalidFilename indicates a non-canonical migration filename. ErrInvalidFilename = errors.New("invalid migration filename") // ErrInvalidFormat indicates malformed or ambiguous migration directives. ErrInvalidFormat = errors.New("invalid migration format") // ErrInvalidEncoding indicates non-UTF-8, NUL-containing, or oversized input. ErrInvalidEncoding = errors.New("invalid migration encoding") // ErrUnexpectedSourceEntry indicates a non-migration entry in the source. ErrUnexpectedSourceEntry = errors.New("unexpected migration source entry") // ErrDuplicateVersion indicates that two source files claim one identity. ErrDuplicateVersion = errors.New("duplicate migration version") // ErrSourceLimit indicates a source inventory whose count, filename data, or // aggregate file content exceeds the finite load budget. ErrSourceLimit = errors.New("migration source limit exceeded") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
// Acquire returns a nonnil exclusively owned session or an error. The
// backend must serialize cooperating jobs, honor cancellation and ensure an
// unsuccessful acquisition does not leave an unmanaged locked connection.
Acquire(context.Context) (Session, error)
}
Backend is the replaceable migration-engine conformance boundary.
Session.Apply must return only after both execution and owned-ledger persistence have reached an explicit recoverable outcome. Implementations must leave a dirty record when non-transactional execution has an uncertain or partial result. Every operation must honor its context and return bounded results required by Session.
type Baseline ¶
type Baseline struct {
// contains filtered or unexported fields
}
Baseline is an immutable reviewed schema assertion for adopting an existing database without replaying historical migrations.
func NewBaseline ¶
NewBaseline validates version, canonical name and nonzero fingerprint. It does not inspect a database or establish that a human reviewed the schema; Runner.Baseline asks the supporting backend to compare the fingerprint.
func (Baseline) Fingerprint ¶
Fingerprint returns the expected canonical schema digest.
type Checksum ¶
type Checksum struct {
// contains filtered or unexported fields
}
Checksum is a SHA-256 digest used for migration identity or a package-defined schema fingerprint. Its zero value is invalid for persisted contracts.
func ChecksumData ¶
ChecksumData hashes the supplied bytes with SHA-256 without normalization, validation or authentication. Callers define any canonical framing; migration identity instead uses the built-in versioned, byte-length-prefixed format.
func ParseChecksum ¶
ParseChecksum accepts exactly sha256: followed by 64 lowercase hexadecimal digits, rejecting the all-zero digest. Other spellings are not normalized.
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is an immutable structured diagnostic suitable for logging and tracing adapters. There is no SQL text field, but an error from a custom dependency can contain sensitive data. The runner does not sanitize every error cause.
func (Event) Err ¶
Err returns the operation error, except that baseline-mismatch observer events use the classification alone. PostgreSQL operation errors redact ordinary formatting but can expose driver causes through error traversal; custom backend errors are retained. Do not log unwrapped causes.
type FSSource ¶
type FSSource struct {
// contains filtered or unexported fields
}
FSSource loads canonical SQL migrations from one cancellation-aware source directory and rejects unrelated entries so packaging mistakes fail closed. It borrows the provider and does not freeze directory/file reads into an atomic snapshot. Use immutable deployment artifacts, not a changing directory.
func NewFSSource ¶
func NewFSSource(sourceFS SourceFileSystem, root string, options ...FSSourceOption) (*FSSource, error)
NewFSSource constructs a source rooted at a valid fs.ValidPath directory of at most MaxMigrationSourceRootBytes. It borrows sourceFS without invoking it itself; caller options run left-to-right until the first nil or failing option.
func (*FSSource) Load ¶
Load reads, validates and sorts the complete migration history using a finite load context and inclusive provider budgets. It returns no partial history on error. Filename versions may have leading zeroes; their numeric identities must be unique. SQL file directives use the owned v1 format, not SQL grammar. Provider errors are reduced to context/budget/encoding classifications or ErrInvalidSource; this does not sanitize arbitrary custom Source errors.
type FSSourceOption ¶
FSSourceOption configures a filesystem source during construction only.
func WithSourceTimeout ¶
func WithSourceTimeout(timeout time.Duration) FSSourceOption
WithSourceTimeout replaces the ten-minute complete-load timeout with a positive duration. This bounds cooperative provider work, not arbitrary code.
type Migration ¶
type Migration struct {
// contains filtered or unexported fields
}
Migration is an immutable canonical SQL migration.
Fields are intentionally private so callers and execution engines cannot mutate identity or persisted checksum state after validation.
func NewMigration ¶
func NewMigration( version Version, name string, transactionMode TransactionMode, upSQL string, downSQL string, ) (Migration, error)
NewMigration validates identity, transaction mode and UTF-8, NUL-free SQL totaling at most 16 MiB. Names contain lowercase ASCII letters/digits with single separating underscores and at most MaxMigrationNameBytes bytes. Up SQL must not be blank; empty down SQL denotes irreversibility, whereas nonempty whitespace-only down SQL is rejected. SQL bytes and line endings are preserved, not parsed for grammar or normalized before the v1 checksum. Unlike FSSource file validation, this constructor does not reject a BOM.
func (Migration) DownSQL ¶
DownSQL returns the canonical rollback SQL, or an empty string when the migration is irreversible.
func (Migration) TransactionMode ¶
func (migration Migration) TransactionMode() TransactionMode
TransactionMode returns the execution transaction policy.
type Observer ¶
type Observer interface {
// Observe receives an event inline. Panics are contained, but blocking is
// not preempted. Cleanup events use a context detached from cancellation;
// observers need their own finite bound for that work.
Observe(context.Context, Event)
}
Observer consumes synchronous migration events. Shared observers must be concurrency-safe and bounded/nonblocking; they are trusted caller code.
type Operation ¶
type Operation uint8
Operation identifies an observable migration lifecycle operation.
const ( // OperationLock acquires exclusive migration-job ownership. OperationLock Operation = iota + 1 // OperationApply applies one migration and persists its outcome. OperationApply // OperationRollback rolls back one migration and removes its ledger record. OperationRollback // OperationBaseline validates and records one reviewed existing schema. OperationBaseline // OperationRecover resolves one explicitly reviewed dirty outcome. OperationRecover // OperationUnlock releases exclusive migration-job ownership. OperationUnlock )
type Option ¶
Option configures a Runner during construction only.
func WithObserver ¶
WithObserver installs a structured event observer. Observer panics are contained; callbacks still run synchronously and can delay work or cleanup. A nil interface is rejected; the caller must ensure any typed value is usable.
func WithUnlockTimeout ¶
WithUnlockTimeout replaces the default 30-second, best-effort release deadline with a positive duration. Release uses context.WithoutCancel so caller cancellation does not skip its attempt. It cannot forcibly bound a blocking observer, uncooperative backend or context-free driver finalizer.
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan is a deterministic execution plan derived from source and ledger state.
func PlanDown ¶
PlanDown validates the complete persisted history and returns exactly count rollback steps in descending version order. Count must be positive and fit the applied history; every selected migration must have down SQL. It never crosses a baseline or proves that down SQL restores the original schema.
func PlanUp ¶
PlanUp validates the complete persisted history and returns pending migrations in ascending version order. Any ambiguity fails closed. Inputs must be strictly ordered, within MaxMigrationFiles/MaxMigrationRecords and form an unchanged clean source prefix above any baseline. It performs no I/O and does not retain the caller's slices.
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record is an immutable entry read from public.migrations.
func NewRecord ¶
func NewRecord( kind RecordKind, version Version, name string, checksum Checksum, appliedAt time.Time, duration time.Duration, dirty bool, ) (Record, error)
NewRecord validates kind, signed-ledger-range version, canonical name, nonzero checksum/time and nonnegative duration. It preserves the supplied timestamp and dirty flag; history ordering, baseline placement and source agreement are separately checked by planners and status builders.
func (Record) AppliedAt ¶
AppliedAt returns the persisted record time. PostgreSQL uses completion time for clean records and attempt start time for dirty records.
func (Record) Kind ¶
func (record Record) Kind() RecordKind
Kind returns whether this record is a migration or baseline.
type RecordKind ¶
type RecordKind uint8
RecordKind distinguishes an executed migration from an explicit schema baseline in the owned ledger.
const ( // RecordKindMigration is a migration executed by this package. RecordKindMigration RecordKind = iota + 1 // RecordKindBaseline is a reviewed pre-existing schema assertion. RecordKindBaseline )
type Recovery ¶
type Recovery struct {
// contains filtered or unexported fields
}
Recovery is an immutable, checksum-bound operator decision.
func NewRecovery ¶
func NewRecovery(version Version, checksum Checksum, action RecoveryAction) (Recovery, error)
NewRecovery validates a nonzero version/checksum and recognized action; it does not inspect SQL effects or enforce the signed ledger version ceiling. Runner.Recover must still match this identity to its validated source.
func (Recovery) Action ¶
func (recovery Recovery) Action() RecoveryAction
Action returns the operator's asserted outcome, not a runtime verification.
type RecoveryAction ¶
type RecoveryAction uint8
RecoveryAction is an explicit operator assertion about a dirty migration.
const ( // RecoveryMarkApplied asserts that the operator verified all up SQL effects. RecoveryMarkApplied RecoveryAction = iota + 1 // RecoveryMarkRolledBack asserts that the operator removed all partial effects. RecoveryMarkRolledBack )
type RecoveryResult ¶
type RecoveryResult struct {
// contains filtered or unexported fields
}
RecoveryResult is the persisted outcome of resolving one dirty migration.
func (RecoveryResult) Action ¶
func (result RecoveryResult) Action() RecoveryAction
Action returns the applied recovery decision.
func (RecoveryResult) Record ¶
func (result RecoveryResult) Record() Record
Record returns the resolved ledger record. MarkRolledBack returns the dirty record that was removed; MarkApplied returns its new clean representation.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result describes the successful acknowledged prefix of one runner Up/Down invocation, including on error. It is not a whole-batch transaction receipt: the failing step or cleanup may also have changed durable database state.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner coordinates source validation, exclusive locking, history revalidation, planning, and backend execution.
func NewRunner ¶
NewRunner borrows source/backend without loading or acquiring them itself. Options are caller code. It rejects nil interfaces/options, applies options left-to-right until failure and starts no goroutines. Typed-nil dependencies and arbitrary callback/backend panics are not generally validated or contained. Operations require a nonnil context and usable dependencies.
func (*Runner) Baseline ¶
Baseline validates and records an existing schema without replaying any historical framework migrations. The owned ledger must be empty, and every Go-owned source migration must have a version strictly above the baseline. The session must implement Baseline(context.Context, Baseline) (Record, error), otherwise ErrBaselineUnsupported is returned. PostgreSQL compares its selected catalog fingerprint transactionally; matching it does not verify every schema or security property. Cleanup errors can follow a committed baseline.
func (*Runner) Down ¶
Down plans exactly count clean applied migrations, newest first, validating loaded source against locked ledger history. Count must be positive; planning fails before SQL if any selected migration is irreversible or crosses a baseline. Execution can stop partway: Result contains acknowledged removals, and an error does not establish that the failing step made no durable change.
func (*Runner) Plan ¶
Plan loads source before locking and validates that history against the locked ledger without executing migration SQL. It can initialize the ledger; it is not an I/O-free operation or a reservation for a later Up call.
func (*Runner) Recover ¶
func (runner *Runner) Recover( ctx context.Context, recovery Recovery, ) (result RecoveryResult, err error)
Recover resolves one checksum-matched dirty migration after the operator has verified that its effects are either fully applied or fully removed. The session must support the Recover method taking context.Context, Migration and RecoveryAction and returning (Record, error), otherwise ErrRecoveryUnsupported is returned. The runner checks source and dirty-record identity but does not execute SQL or verify the asserted effects. A release error can follow a persisted recovery decision.
func (*Runner) Status ¶
Status loads source before locking, prepares/reads the ledger under the session lock and returns their validated status. It does not inspect live SQL effects or freeze source changes; ledger preparation may execute SQL.
func (*Runner) Up ¶
Up loads source, acquires a session and validates that loaded history against the locked ledger before applying pending steps in ascending order. The lock coordinates backend jobs, not source mutations or unrelated database writers. Each step has its own backend transaction policy, not a batch transaction. On failure Result contains only earlier acknowledged steps; inspect database and ledger state before retry because the failing step or cleanup may have followed durable changes. The runner does not retry automatically.
type Session ¶
type Session interface {
// Prepare initializes the owned ledger on the lock-owning connection. It
// may execute SQL even for a plan/status operation.
Prepare(context.Context) error
// Records returns the complete, version-ordered ledger within
// MaxMigrationRecords, with returned data stable for the caller to validate.
Records(context.Context) ([]Record, error)
// Apply executes up SQL and persists its matching clean record on success.
// Transactional SQL and ledger writes must be atomic; nontransactional work
// must persist dirty state before executing SQL. Errors can follow durable
// changes and must not be interpreted as proof that nothing ran.
Apply(context.Context, Migration) (Record, error)
// Rollback executes down SQL and removes the matching record on success,
// returning the removed clean record. It has the same transactional and
// explicit dirty-outcome obligations as Apply.
Rollback(context.Context, Migration) (Record, error)
// Release relinquishes the session's connection and exclusive ownership.
// Runner attempts it once after acquisition using a detached finite context;
// cleanup errors are joined with any operation error.
Release(context.Context) error
}
Session represents exclusive migration-job ownership bound to one physical database connection. Ledger preparation, reads, and execution all happen through this value so connection loss and lock loss cannot be separated from execution and a one-connection pool cannot deadlock during preparation. Records must return at most MaxMigrationRecords entries.
type Source ¶
type Source interface {
// Load returns a complete history or an error, not a usable partial history.
// It runs before the runner acquires the database lock.
Load(context.Context) ([]Migration, error)
}
Source loads a complete immutable migration history. Implementations must honor the supplied context, return at most MaxMigrationFiles entries in strictly increasing version order, and keep returned data stable during use. Runner retains source errors without removing their causes; custom sources must keep their own diagnostics safe.
type SourceDirectoryLimits ¶
type SourceDirectoryLimits struct {
// MaxEntries is the largest complete entry inventory.
MaxEntries int
// MaxNameBytes is the largest individual entry name.
MaxNameBytes int
// MaxTotalNameBytes is the largest aggregate entry-name payload.
MaxTotalNameBytes int
}
SourceDirectoryLimits are inclusive budgets that a SourceFileSystem must enforce before retaining or returning directory metadata.
type SourceEntry ¶
type SourceEntry struct {
// Name is the base filename within the source root.
Name string
// Directory reports whether the entry is a directory.
Directory bool
}
SourceEntry is the bounded directory metadata needed to discover a migration.
type SourceFileSystem ¶
type SourceFileSystem interface {
// ReadDir returns the complete directory inventory, including unrelated
// entries for FSSource to reject. It must bound metadata before retention.
ReadDir(ctx context.Context, root string, limits SourceDirectoryLimits) ([]SourceEntry, error)
// ReadFile returns at most maxBytes of stable file content, enforcing the
// bound before retaining it and closing any provider-owned file handles.
ReadFile(ctx context.Context, name string, maxBytes int) ([]byte, error)
}
SourceFileSystem provides cancellation-aware, bounded migration file access. Implementations must pass ctx to every blocking operation, stop promptly on cancellation, and enforce the supplied inclusive limits before retaining input data. They return context errors for cancellation, ErrSourceLimit or ErrInvalidEncoding for exceeded budgets, and a private implementation error for other failures; FSSource redacts those private errors as ErrInvalidSource.
type State ¶
type State uint8
State is the deterministic relationship between source and owned ledger.
const ( // StateBaseline is the reviewed adoption boundary for an existing schema. StateBaseline State = iota + 1 // StateApplied is a clean, checksum-matched applied migration. StateApplied // StateDirty is an explicitly unresolved partial or uncertain outcome. StateDirty // StatePending is a source migration not yet represented in the ledger. StatePending )
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is an immutable, version-ordered snapshot.
func BuildStatus ¶
BuildStatus validates source and persisted identity while preserving dirty entries as explicit status instead of hiding them behind a generic error. Inputs obey the same ordering and retention limits as PlanUp. It performs no I/O, retains no input slices and does not inspect live SQL effects or schema.
func (Status) Entries ¶
func (status Status) Entries() []StatusEntry
Entries returns a copy so callers cannot mutate the validated snapshot.
type StatusEntry ¶
type StatusEntry struct {
// contains filtered or unexported fields
}
StatusEntry is one immutable source or ledger status item.
func (StatusEntry) AppliedAt ¶
func (entry StatusEntry) AppliedAt() time.Time
AppliedAt returns the persisted record time, or zero for pending work. For PostgreSQL dirty entries this is attempt start, not completion time.
func (StatusEntry) Checksum ¶
func (entry StatusEntry) Checksum() Checksum
Checksum returns the source checksum or persisted baseline fingerprint.
func (StatusEntry) Duration ¶
func (entry StatusEntry) Duration() time.Duration
Duration returns the persisted execution duration, or zero for pending work.
func (StatusEntry) Name ¶
func (entry StatusEntry) Name() string
Name returns the canonical migration or baseline name.
func (StatusEntry) State ¶
func (entry StatusEntry) State() State
State returns the item's deterministic state.
func (StatusEntry) Version ¶
func (entry StatusEntry) Version() Version
Version returns the migration or baseline version.
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
Step is one immutable action in a deterministic plan.
type TransactionMode ¶
type TransactionMode uint8
TransactionMode controls whether an engine wraps a migration in a database transaction.
const ( // TransactionModeDefault requests one transaction for SQL and ledger writes. TransactionModeDefault TransactionMode = iota // TransactionModeNone permits operations PostgreSQL cannot run in a // transaction. An unresolved dirty outcome requires explicit recovery. TransactionModeNone )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
service
Package migrationsservice adapts an explicit migrations.Runner to the standard Service v3 migrate command.
|
Package migrationsservice adapts an explicit migrations.Runner to the standard Service v3 migrate command. |
|
Package conformance provides the reusable behavioral test suite every migration backend must pass without depending on its execution engine.
|
Package conformance provides the reusable behavioral test suite every migration backend must pass without depending on its execution engine. |
|
examples
|
|
|
job
command
Command job runs embedded migrations as a dedicated deployment task with a caller-owned database and immutable compiler-embedded source.
|
Command job runs embedded migrations as a dedicated deployment task with a caller-owned database and immutable compiler-embedded source. |
|
internal
|
|
|
goose
Package goose contains the replaceable, hidden Goose execution adapter pinned by go.mod.
|
Package goose contains the replaceable, hidden Goose execution adapter pinned by go.mod. |
|
Package postgres implements the public.migrations ledger and connection-bound advisory-lock backend for migrations.Runner.
|
Package postgres implements the public.migrations ledger and connection-bound advisory-lock backend for migrations.Runner. |