Documentation
¶
Overview ¶
Package database is the database client tier: it selects a SQL connection-pool backend — PostgreSQL today (postgres/) — by Kind and returns the interfaces.DatabasePool contract, so switching database engines is a config change, not a caller edit. The contract lives in core (interfaces.DatabasePool); the backend implements it; this is the factory, mirroring the cache/storage NewFromConfig shape.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromConfig ¶
func NewFromConfig(cfg Config) (interfaces.DatabasePool, error)
NewFromConfig builds the database pool selected by cfg.Kind: the PostgreSQL pool (KindPostgres) today. It is the app-wiring entrypoint mirroring the cache/storage NewFromConfig factory; the returned pool is not opened until Start.
Types ¶
type Config ¶
type Config struct {
// Database holds the connection settings (DSN, pool sizing) for the backend.
Database *infra.DatabaseConfig
// Kind selects the backend. The zero value is KindPostgres.
Kind Kind
}
Config selects and configures the database backend.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package postgres is the PostgreSQL backend of the database client tier: a lifecycle-managed *sql.DB pool (Client) plus ORM-independent pool utilities — a boot-time reachability probe (Ping) and a Prometheus pool-stats collector.
|
Package postgres is the PostgreSQL backend of the database client tier: a lifecycle-managed *sql.DB pool (Client) plus ORM-independent pool utilities — a boot-time reachability probe (Ping) and a Prometheus pool-stats collector. |