Skip to main content

Module pool

Module pool 

Source
Expand description

PgPool construction helper.

RFC-v0.7 Wave 0. Reads BackendConnection::Postgres { url, max_connections, min_connections, acquire_timeout } and builds a sqlx::PgPool. Future waves add TLS root-store plumbing, LISTEN- connection setup (Q1 + Q2), transaction-pooler detection (Q2 footnote on PgBouncer session-mode requirement), etc. Today this is a thin pass-through to sqlx::postgres::PgPoolOptions so the backend connect constructor has a single call site for pool setup.

Functions§

build_pool
Build a sqlx::PgPool from a BackendConfig whose connection arm is BackendConnection::Postgres.
build_pool_from_connection
Lower-level helper: build a PgPool directly from a PostgresConnection. Separated from build_pool so tests + future migration-CLI tooling can feed a bare connection shape without constructing a full BackendConfig.