Documentation
¶
Overview ¶
Package stdpgtest provides testing against a postgresql database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtlasDirMigrator ¶ added in v0.0.24
type AtlasDirMigrator struct { MigrationsDirPath string AtlasEnv string AtlasConfig string // contains filtered or unexported fields }
AtlasDirMigrator is a pgtestdb.Migrator that uses the `atlas` CLI tool to perform migrations.
atlas migrate apply --url $DB --dir file://$migrationsDirPath
AtlasDirMigrator requires that it runs in an environment where the `atlas` CLI is in the $PATH. It shells out to that program to perform its migrations, as recommended by the Atlas maintainers.
AtlasDirMigrator does not perform any Verify() or Prepare() logic.
func NewAtlasDirMigrator ¶ added in v0.0.24
func NewAtlasDirMigrator( migrationsDirPath string, atlasEnv string, atlasConfig string, execute func(ctx context.Context, stdin io.Reader, program string, args ...string) (string, error), ) *AtlasDirMigrator
NewAtlasDirMigrator returns a AtlasDirMigrator, which is a pgtestdb.Migrator that uses the `atlas` CLI tool to perform migrations.
atlas migrate apply --url $DB --dir file://$migrationsDirPath
func (*AtlasDirMigrator) Hash ¶ added in v0.0.24
func (m *AtlasDirMigrator) Hash() (string, error)
type SnapshotMigrator ¶ added in v0.0.24
type SnapshotMigrator[T interface { ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) }] string
SnapshotMigrator loads a migration from a postgres dump file.
func (SnapshotMigrator[T]) Hash ¶ added in v0.0.24
func (m SnapshotMigrator[T]) Hash() (string, error)
Hash implements the migrater interface.