Versions in this module Expand all Collapse all v0 v0.1.0 Aug 19, 2026 Changes in this version + var ErrAlreadyApplied = errors.New("migration: already applied") + var ErrInvalidVersion = errors.New("migration: invalid version") + var ErrMigrationNotFound = errors.New("migration: version not found") + var ErrNoMigrations = errors.New("migration: no migrations found") + var ErrNotApplied = errors.New("migration: not applied") + type EmbedSource struct + func NewEmbedSource(fsys fs.FS, root string) *EmbedSource + func (s *EmbedSource) Migrations() ([]Migration, error) + type FileSource struct + func NewFileSource(dir string) *FileSource + func (s *FileSource) Migrations() ([]Migration, error) + type Migration struct + Description string + DownSQL string + UpSQL string + Version uint64 + func (m *Migration) HasDown() bool + func (m *Migration) HasUp() bool + func (m *Migration) String() string + type MigrationStatus struct + Applied bool + AppliedAt string + type Migrator interface + Close func() error + Down func(ctx context.Context) error + DownTo func(ctx context.Context, version uint64) error + Status func(ctx context.Context) ([]MigrationStatus, error) + Steps func(ctx context.Context, n int) error + Up func(ctx context.Context) error + UpTo func(ctx context.Context, version uint64) error + Version func(ctx context.Context) (uint64, bool, error) + type Source interface + Migrations func() ([]Migration, error) + type StaticSource struct + func NewStaticSource(migrations ...Migration) *StaticSource + func (s *StaticSource) Migrations() ([]Migration, error)