Skip to main content

pool_options

Function pool_options 

Source
pub fn pool_options(policy: WritablePolicy) -> PoolOptions<Postgres>
Expand description

Pool options for a pool whose write-session guarantee is policy – see WritablePolicy.

Both variants install after_connect/before_acquire hooks that run SHOW transaction_read_only and test_before_acquire(false): the before_acquire query already makes one round trip and fails on a dead connection, so it replaces sqlx’s default ping, keeping the hot path at one round trip per acquire.