Expand description
Client-facing protocol handlers. The pool checks out server connections; this module decides what to do with them — classify queries, intercept session-affecting commands, forward messages, and translate between client-visible prepared statement names and the pool-wide canonical ones.
Modules§
- frontend
- Per-client wire-protocol entry point. Drives the PostgreSQL
startup handshake (SSL/GSS negotiation,
StartupMessageparsing, cancel forwarding), authenticates, checks out an initial server connection, sets up multiplexed LISTEN when configured, and dispatches tocrate::proxy::session::forwardorcrate::proxy::transaction::forwardbased on the pool mode. - intercept
- Message interceptors that produce synthetic client-facing
responses without involving the upstream server. Each handler
either consumes the message (returns
true) or defers it to the normal forwarding path (returnsfalse). - prepared
- Per-client prepared statement state and server-side rewriting.
- session
- transaction
- Transaction-mode proxy: the outer loop cycles between an idle
state (no server connection) and an active state (holding a
checked-out
crate::connections::server::ServerConnfor the duration of a single transaction). OnReadyForQuery(Idle)the connection is returned to the pool; onTerminateor disconnect the loop exits.