Documentation
¶
Index ¶
Constants ¶
View Source
const ( MigrationsRoot = "db/migrations" DefaultListLimit = 50 MaxListLimit = 100 )
Variables ¶
This section is empty.
Functions ¶
func AdjustListLimit ¶
Types ¶
type DBConfig ¶
type DBConfig struct {
Enabled bool `yaml:"enabled"`
Username string `yaml:"username"`
Password string `yaml:"password"`
Database string `yaml:"database"`
Hostname string `yaml:"hostname"`
Port int `yaml:"port"`
MaxConns int32 `yaml:"maxConns"`
MinConns int32 `yaml:"minConns"`
MaxConnIdleTime time.Duration `yaml:"maxConnIdleTime"`
MaxConnLifetime time.Duration `yaml:"maxConnLifetime"`
HealthCheckPeriod time.Duration `yaml:"healthCheckPeriod"`
// MigrationRetryTimeout and MigrationRetryInterval bound how long
// runDBMigrations keeps retrying a dirty migration before giving up.
// Services in a bundle can start in no particular order, and a
// migration's DDL may depend on a schema/table that another
// service's own migration creates (see e.g. the provisioner's
// db/migrations, which FKs into the identity schema). Since the
// postgres driver sends a whole migration file as a single implicit
// transaction, a failed migration never leaves partial DDL behind —
// only the dirty marker survives the rollback — so it's safe to
// clear that marker and retry until the dependency appears.
MigrationRetryTimeout time.Duration `yaml:"migrationRetryTimeout"`
MigrationRetryInterval time.Duration `yaml:"migrationRetryInterval"`
}
func (*DBConfig) ConnString ¶
func (*DBConfig) SetDefaults ¶
func (c *DBConfig) SetDefaults()
Click to show internal directories.
Click to hide internal directories.