database

package
v0.0.0-...-f78dc83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresPool

func NewPostgresPool(ctx context.Context, cfg PoolConfig) (*pgxpool.Pool, error)

NewPostgresPool creates a pgx connection pool from PoolConfig. DSN is built by each service's config via PoolConfig.DSN. In production, DSN contains credentials injected by k8s Secrets (via external-secrets). Locally, DSN is built from .env file values.

Types

type PoolConfig

type PoolConfig struct {
	DSN                   string
	MaxConns              int
	MinConns              int
	MaxConnLifetime       time.Duration
	MaxConnLifetimeJitter time.Duration
	MaxConnIdleTime       time.Duration
	HealthCheckPeriod     time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL