Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostgresSQLConnection ¶
func PostgresSQLConnectionWithConfig ¶ added in v1.0.0
func PostgresSQLConnectionWithConfig(cfg PostgresConfig, deps PostgresDeps) (*gorm.DB, error)
PostgresSQLConnectionWithConfig starts a Postgres connection using explicit config and deps.
Types ¶
type PostgresConfig ¶ added in v1.0.0
PostgresConfig defines pooled connection settings.
func PostgresConfigFromEnv ¶ added in v1.0.0
func PostgresConfigFromEnv() (PostgresConfig, error)
PostgresConfigFromEnv reads database pool config from environment variables.
type PostgresDeps ¶ added in v1.0.0
type PostgresDeps struct {
BuildConnectionURL func(name string) (string, error)
Open func(dsn string) (*gorm.DB, error)
}
PostgresDeps defines external dependencies to keep connection setup testable.
func DefaultPostgresDeps ¶ added in v1.0.0
func DefaultPostgresDeps() PostgresDeps
DefaultPostgresDeps returns production defaults for Postgres dependencies.
Click to show internal directories.
Click to hide internal directories.