Documentation
¶
Overview ¶
Package stdpgxfx provides sql.DB connection pools usng pgx/v5.
Index ¶
- func Provide(mainPoolName string, derivedPoolNames ...string) fx.Option
- func ProvideDeriver(name string, deriver Deriver) fx.Option
- func TestProvide(tb testing.TB, mainPoolName string, derivedPoolNames ...string) fx.Option
- type AfterMigrateRole
- type Config
- type Deriver
- type Params
- type PgtestdbTestMigratorParams
- type Result
- type TestMigrator
- type TestMigratorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvideDeriver ¶ added in v0.0.13
ProvideDeriver is a short-hande function for providing a named deriver function that.
Types ¶
type AfterMigrateRole ¶ added in v0.0.58
AfterMigrateRole can be optionally provided to further customize the role used to connect to the database that was just migrated. This is useful if the eventual role being used from the application is different from the migration (superuser) role and the testrole.
type Config ¶
type Config struct { // RWDatabaseURL configures the database connection string for the read-write connection. RWDatabaseURL string `env:"RW_DATABASE_URL"` }
Config configures the module.
type Deriver ¶ added in v0.0.13
Deriver needs to be provided by the user of this module if derived pools are created.
type PgtestdbTestMigratorParams ¶ added in v0.0.58
type TestMigrator ¶ added in v0.0.58
type TestMigrator interface { Migrate( tb testing.TB, cfg Config, pcfg *pgxpool.Config, ) (*pgxpool.Config, error) }
TestMigrator can be implemented and provided to migrate the database for tests.
func NewPgtestdbTestMigrator ¶ added in v0.0.58
func NewPgtestdbTestMigrator(params PgtestdbTestMigratorParams) TestMigrator
NewPgtestdbTestMigrator implements the TestMigrator using the pgtestdb library.