Documentation
¶
Overview ¶
Package config provides database configuration helpers for PostgreSQL connections for the example: Book circulation in a public library
This package contains factory functions for creating database connections using different PostgreSQL drivers (pgx.Pool, sql.DB, sqlx.DB) with pre-configured test and benchmark database DSNs.
This package is part of the shell (infrastructure) layer, providing database connection configuration for the event sourcing system.
Index ¶
- func PostgresBenchmarkDSN() string
- func PostgresPGXPoolBenchmarkConfig() *pgxpool.Config
- func PostgresPGXPoolTestConfig() *pgxpool.Config
- func PostgresSQLDBBenchmarkConfig() *sql.DB
- func PostgresSQLDBTestConfig() *sql.DB
- func PostgresSQLXBenchmarkConfig() *sqlx.DB
- func PostgresSQLXTestConfig() *sqlx.DB
- func PostgresTestDSN() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostgresBenchmarkDSN ¶
func PostgresBenchmarkDSN() string
PostgresBenchmarkDSN returns the DSN for the benchmark database.
func PostgresPGXPoolBenchmarkConfig ¶
PostgresPGXPoolBenchmarkConfig creates a pgxpool.Config for the benchmark database.
func PostgresPGXPoolTestConfig ¶
PostgresPGXPoolTestConfig creates a pgxpool.Config for the test database.
func PostgresSQLDBBenchmarkConfig ¶
PostgresSQLDBBenchmarkConfig creates a configured *sql.DB for the benchmark database.
func PostgresSQLDBTestConfig ¶
PostgresSQLDBTestConfig creates a configured *sql.DB for the test database.
func PostgresSQLXBenchmarkConfig ¶
PostgresSQLXBenchmarkConfig creates a configured *sqlx.DB for the benchmark database.
func PostgresSQLXTestConfig ¶
PostgresSQLXTestConfig creates a configured *sqlx.DB for the test database.
func PostgresTestDSN ¶
func PostgresTestDSN() string
PostgresTestDSN returns the DSN for the test database.
Types ¶
This section is empty.