Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbmateMigrator ¶
DbmateMigrator is a pgtestdb.Migrator that uses dbmate to perform migrations.
DbmateMigrator does not perform any Verify() or Prepare() logic.
func New ¶
func New(opts ...Option) *DbmateMigrator
New returns a DbmateMigrator, which is a pgtestdb.Migrator that uses dbmate to perform migrations.
You can configure the behavior of dbmate by passing Options:
- WithDir is the same as --migrations-dir
- WithTableName is the same as --migrations-table
- WithFS allows you to use an embedded filesystem.
func (*DbmateMigrator) Hash ¶
func (m *DbmateMigrator) Hash() (string, error)
type Option ¶
type Option func(*DbmateMigrator)
Option provides a way to configure the DbmateMigrator struct and its behavior.
dbmate documentation: https://github.com/amacneil/dbmate#command-line-options
See:
func WithDir ¶
WithDir specifies the location(s) of the migration files. If you have migrations in multiple directories, you should pass each path here instead of passing WithDir multiple times.
Default: `"./db/migrations"`
Equivalent to `--migrations-dir` https://github.com/amacneil/dbmate#command-line-options
func WithFS ¶
WithFS specifies a `fs.FS` from which to read the migration files.
Default: `<nil>` (reads from the real filesystem)
func WithTableName ¶
WithTableName specifies the name of the table in which dbmate will store its migration records.
Default: `"schema_migrations"`
Equivalent to `--migrations-table` https://github.com/amacneil/dbmate#command-line-options