Versions in this module Expand all Collapse all v0 v0.1.0 Sep 7, 2026 Changes in this version + const AutoUpdatedAtSelector + const SplitDirective + const TxDownSuffix + const TxUpSuffix + var ErrNoConnection = errors.New("bunmigrator: the rendering DB cannot connect") + func Apply(ctx context.Context, db *bun.DB, ms *migrate.Migrations) (*migrate.MigrationGroup, error) + func AutoUpdatedAtTrigger(table string) string + func Discover(db *bun.DB, steps []Step) (*migrate.Migrations, error) + func FS(db *bun.DB, steps []Step) (fstest.MapFS, error) + func RenderDB() *bun.DB + func Rollback(ctx context.Context, db *bun.DB, ms *migrate.Migrations) (*migrate.MigrationGroup, error) + func Stem(seq int, slug string) string + func WriteDir(dir string, fsys fs.FS) error + type AutoUpdatedAt struct + func NewAutoUpdatedAt(seq int) AutoUpdatedAt + func (f AutoUpdatedAt) DependsOn() []string + func (f AutoUpdatedAt) Down(*bun.DB) ([]string, error) + func (f AutoUpdatedAt) Selector() string + func (f AutoUpdatedAt) Seq() int + func (f AutoUpdatedAt) Slug() string + func (f AutoUpdatedAt) Up(*bun.DB) ([]string, error) + type Change struct + Action string + Kind string + Name string + func Changes(ms migrate.MigrationSlice, rollback bool) []Change + func (c Change) String() string + type Enum struct + func NewEnum(seq int, selector, typeName string, members []string) Enum + func (e Enum) DependsOn() []string + func (e Enum) Down(*bun.DB) ([]string, error) + func (e Enum) Selector() string + func (e Enum) Seq() int + func (e Enum) Slug() string + func (e Enum) Up(*bun.DB) ([]string, error) + type Registry struct + func NewRegistry(targets ...Target) (Registry, error) + func (r Registry) Lookup(selector string) (Target, bool) + func (r Registry) Plan(selectors ...string) ([]Step, error) + func (r Registry) Selectors() []string + func (r Registry) Targets() []Target + type Step struct + Stem string + Target Target + type Table struct + func NewTable(seq int, selector, tableName string, mdl any, opts ...TableOption) Table + func (t Table) DependsOn() []string + func (t Table) Down(*bun.DB) ([]string, error) + func (t Table) Selector() string + func (t Table) Seq() int + func (t Table) Slug() string + func (t Table) Up(db *bun.DB) ([]string, error) + type TableOption func(*Table) + func ColumnExpr(expr string) TableOption + func DependsOn(selectors ...string) TableOption + func ForeignKey(clause string) TableOption + func Index(columns ...string) TableOption + func LiveUniqueIndex(columns ...string) TableOption + func WithAutoUpdatedAt() TableOption + type Target interface + DependsOn func() []string + Down func(db *bun.DB) ([]string, error) + Selector func() string + Seq func() int + Slug func() string + Up func(db *bun.DB) ([]string, error)