pub struct PoolPrewarmConfig {
pub min_size: usize,
pub max_size: usize,
pub timeout_secs: Option<u64>,
}Expand description
Configuration for connection pool construction and pre-warming.
Controls the minimum guaranteed connections (pre-warmed at startup), the maximum pool ceiling, and the wait/create timeout for connection acquisition.
§Example
use fraiseql_db::postgres::PoolPrewarmConfig;
let cfg = PoolPrewarmConfig {
min_size: 5,
max_size: 20,
timeout_secs: Some(30),
};Fields§
§min_size: usizeNumber of connections to establish at pool creation time.
After the pool is created, min_size connections are opened eagerly
so they are ready when the first request arrives. Set to 0 to disable
pre-warming (lazy init — one connection from the startup health check).
max_size: usizeMaximum number of connections the pool may hold.
timeout_secs: Option<u64>Optional timeout (in seconds) for connection acquisition and creation.
Applied to both the wait (blocked waiting for an idle connection) and
create (time to open a new TCP connection to PostgreSQL) deadpool slots.
When None, acquisition can block indefinitely on pool exhaustion.
Trait Implementations§
Source§impl Clone for PoolPrewarmConfig
impl Clone for PoolPrewarmConfig
Source§fn clone(&self) -> PoolPrewarmConfig
fn clone(&self) -> PoolPrewarmConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more