Versions in this module Expand all Collapse all v0 v0.1.0 Feb 28, 2022 Changes in this version + var ErrDBNotDefined = errors.New("Database connection is not defined yet") + func ConnectionString(conf *Config) string + func ConnectionURL(conf *Config) string + func Migrate(conf *Config, logger *logger.Logger, direction string, version int) error + type Config struct + DatabaseName string + Host string + MaxIdleConnections int + MaxLifetime int + MaxOpenConnections int + MigrationPath string + Password string + Port int + Username string + type Database interface + Close func() error + Exec func(query string, args ...interface{}) (sql.Result, error) + GetDB func() *sqlx.DB + Query func(query string, args ...interface{}) (*sqlx.Rows, error) + QueryRow func(query string, args ...interface{}) *sqlx.Row + Select func(dest interface{}, query string, args ...interface{}) error + func NewDatabase(conf *Config, logger *logger.Logger) (Database, error)