Documentation
¶
Index ¶
- type Config
- type Datasource
- type Module
- func (m *Module) ConnectDefault() (*sql.DB, error)
- func (m *Module) GetBackend(dbname string) (backend, error)
- func (m *Module) Init(c *service.Config)
- func (m *Module) SetBackOff(b backoff.BackOff)
- func (m *Module) SetMigrationFS(f fs.FS)
- func (m *Module) SetMigrationSource(asset assetFunc, assetDir assetDirFunc, dir string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Datasources map[string]Datasource `json:"datasources"`
MigrationsDir string `json:"migrations"`
MigrationsTable string `json:"migrations_table"`
}
Config for migrate module
type Datasource ¶
Datasource is parsed from the config
type Module ¶
type Module struct {
Config *config.Module
DB *sql.DB
Logger *logger.Module
// contains filtered or unexported fields
}
Module migrate provides support for migrating postgres databases using rubenv/sql-migrate
func (*Module) ConnectDefault ¶
ConnectDefault to the DB with name specified by env
func (*Module) GetBackend ¶
GetBackend selects the datasource identified by dbname in the config file and initializes the correct type of backend.
func (*Module) SetBackOff ¶
func (*Module) SetMigrationFS ¶ added in v1.5.4
SetMigrationSource sets the migration source, for compatibility with embedded file assets.
func (*Module) SetMigrationSource ¶
SetMigrationSource sets the migration source, for compatibility with embedded file assets.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.