Versions in this module Expand all Collapse all v0 v0.0.14 Jan 4, 2023 Changes in this version + const Driver + var ErrCreateDBInstance = errors.New("error while creating a new DB instance") + var ErrDBMigrationFailed = errors.New("db migration failed") + var ErrDBOpen = errors.New("error opening database") + var ErrMigrationLoad = errors.New("error loading new migrations") + type Config struct + Driver string + Host string + MigrationsPath string + Name string + Password string + Port int + SSLMode string + User string + func NewConfig() *Config + func (c *Config) GetURI() string + type Initializer struct + func NewInitializer(pg *Postgres) *Initializer + func (i *Initializer) AddDependency(dep interface{}) error + func (i *Initializer) CanRun() bool + func (i *Initializer) CanStop() bool + func (i *Initializer) Dependencies() []string + func (i *Initializer) Run(ctx context.Context) error + func (i *Initializer) Stop(ctx context.Context) error + type Postgres struct + Handle *sql.DB + func NewPostgres() *Postgres + func (db *Postgres) HasInitializer() bool + func (db *Postgres) Initializer() component.Initializer + func (db *Postgres) Migrate() error