Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GolangMigrator ¶
GolangMigrator is a sqlitestdb.Migrator that uses golang-migrate to perform migrations.
Because [Hash] requires calculating a unique hash based on the contents of the migrations, this implementation only supports reading migration files from disk or an embedded filesystem.
func New ¶
func New(migrationsDir string, opts ...Option) *GolangMigrator
New returns a GolangMigrator, which implements sqlitestdb.Migrator using golang-migrate to perform up migrations.
func (*GolangMigrator) Hash ¶
func (gm *GolangMigrator) Hash() (string, error)
func (*GolangMigrator) Migrate ¶
func (gm *GolangMigrator) Migrate(_ context.Context, _ *sql.DB, templateConfig sqlitestdb.Config) error
Migrate runs migrate.Up() to migrate the template database.
type Option ¶
type Option func(*GolangMigrator)
Option provides a way to configure the GolangMigrator struct and its behavior.
golang-migrate documentation: https://github.com/golang-migrate/migrate
Click to show internal directories.
Click to hide internal directories.