Documentation ¶
Index ¶
- type Option
- type PGMigrator
- func (pgm *PGMigrator) Hash() (string, error)
- func (pgm *PGMigrator) Migrate(ctx context.Context, db *sql.DB, _ pgtestdb.Config) error
- func (*PGMigrator) Prepare(_ context.Context, _ *sql.DB, _ pgtestdb.Config) error
- func (pgm *PGMigrator) Verify(ctx context.Context, db *sql.DB, _ pgtestdb.Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*PGMigrator)
Option provides a way to configure the PGMigrator struct and its behavior.
pgmigrate documentation: https://github.com/peterldowns/pgmigrate
See:
func WithLogger ¶
WithLogger sets the pgmigrate.Logger to use when applying migrations.
You probably want to use `pgmigrate.NewTestLogger(t)`.
Default: `nil`
func WithTableName ¶
WithTableName specifies the name of the table in which pgmigrate will store its migration records.
Default: `"pgmigrate_migrations"`
type PGMigrator ¶
type PGMigrator struct {
// contains filtered or unexported fields
}
PGMigrator is a pgtestdb.Migrator that uses pgmigrate to perform migrations.
PGMigrator does not perform any Prepare() logic, but does implement Verify().
func New ¶
func New(dir fs.FS, opts ...Option) (*PGMigrator, error)
New returns a PGMigrator, which is a pgtestdb.Migrator that uses pgmigrate to perform migrations.
func (*PGMigrator) Hash ¶
func (pgm *PGMigrator) Hash() (string, error)