Documentation ¶
Index ¶
- type DumpOption
- type DumpOptions
- type Env
- func (e *Env) CreateDB(ctx context.Context) (*TestDB, error)
- func (e *Env) DumpDatabaseSchema(ctx context.Context, dbName string, opts ...DumpOption) (string, error)
- func (e *Env) GetMigratedDB(ctx context.Context, t testing.TB) *pgxpool.Pool
- func (e *Env) TearDown(ctx context.Context) error
- func (e *Env) WithMigratedDB(ctx context.Context, fn func(*pgxpool.Pool) error) error
- type Migrator
- type Option
- type StepMigrator
- type TestDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DumpOption ¶
type DumpOption func(*DumpOptions)
func WithCustomDisclaimer ¶
func WithCustomDisclaimer(disclaimer string) DumpOption
func WithHumanReadableSchema ¶
func WithHumanReadableSchema() DumpOption
type DumpOptions ¶
type DumpOptions struct {
// contains filtered or unexported fields
}
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func (*Env) DumpDatabaseSchema ¶
func (*Env) GetMigratedDB ¶
type Option ¶
type Option func(*options)
Option allows configuring the test environment created by testpgx.
func WithDockerBinaryPath ¶
WithDockerBinaryPath sets the path to the local Docker binary. If blank, the default is to look in $PATH for the executable.
func WithMaxDBs ¶
WithMaxDBs controls the number of DBs, which corresponds to the number of parallel executions. Test errors can occur if there are too many DBs created (because of memory limits). Defaults to 10.
func WithMigrator ¶
WithMigrator allows specifing a migration system to populate the database schema. If not specified, the database will be empty (e.g. have no tables or anything).
func WithPostgresDockerImage ¶
WithPostgresDockerImage csets the Docker image to use for running PostgreSQL. It defaults to 'postgres:14.4'