pub struct PoolConfig {
pub path: Option<PathBuf>,
pub max_readers: usize,
pub wal_mode: bool,
pub busy_timeout: Duration,
pub checkout_timeout: Duration,
pub wal_autocheckpoint_pages: u32,
pub journal_size_limit_bytes: i64,
}Expand description
Configuration for the connection pool.
Fields§
§path: Option<PathBuf>Database path. None = in-memory (pool degrades to single connection).
max_readers: usizeNumber of reader connections (default: min(num_cpus, 8)).
wal_mode: boolWAL mode (must be true for pooling to work; default: true).
busy_timeout: DurationBusy timeout per connection (default: 30s).
Overridable via KHIVE_BUSY_TIMEOUT_SECS.
checkout_timeout: DurationTime to wait for a reader connection before returning an error (default: 5s).
Overridable via KHIVE_CHECKOUT_TIMEOUT_SECS.
wal_autocheckpoint_pages: u32Number of WAL pages that triggers an automatic checkpoint.
Maps to PRAGMA wal_autocheckpoint. The default (4000 pages, ~16 MiB
at SQLite’s default 4 KiB page size) matches the pre-config behaviour.
Overridable via KHIVE_WAL_AUTOCHECKPOINT_PAGES.
journal_size_limit_bytes: i64Maximum WAL journal size in bytes before SQLite resets the WAL.
Maps to PRAGMA journal_size_limit. Default: 64 MiB.
Overridable via KHIVE_JOURNAL_SIZE_LIMIT_BYTES.
Trait Implementations§
Source§impl Clone for PoolConfig
impl Clone for PoolConfig
Source§fn clone(&self) -> PoolConfig
fn clone(&self) -> PoolConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more