Documentation ¶
Index ¶
Constants ¶
View Source
const ( Postgres = "postgres" Sqlite = "sqlite" )
Variables ¶
This section is empty.
Functions ¶
func OpenDbConnection ¶
Opens a connection to the database specified in the config. You must call CloseDbConnection at the end of your session!
Types ¶
type BaseConfig ¶
type DbConnectionConfigProvider ¶
type DbConnectionConfigProvider interface { // Returns database dialector GetDialector() gorm.Dialector GetDBConfig() database.DbConfig GetDSN() string }
Generic interface for providing a config necessary to open a database connection.
func NewPostgresConfigProvider ¶
func NewPostgresConfigProvider(config database.DbConfig, scope promutils.Scope) DbConnectionConfigProvider
TODO : Make the Config provider itself env based
type PostgresConfigProvider ¶
type PostgresConfigProvider struct {
// contains filtered or unexported fields
}
PostgreSQL implementation for DbConnectionConfigProvider.
func (*PostgresConfigProvider) GetDBConfig ¶
func (p *PostgresConfigProvider) GetDBConfig() database.DbConfig
func (*PostgresConfigProvider) GetDSN ¶
func (p *PostgresConfigProvider) GetDSN() string
func (*PostgresConfigProvider) GetDialector ¶
func (p *PostgresConfigProvider) GetDialector() gorm.Dialector
Click to show internal directories.
Click to hide internal directories.