pub struct ReadPoolOptions { /* private fields */ }Expand description
Options for a ReadPool. The default (ReadPoolOptions::new) matches
DbOptions::open_read_pool: read-write file handles, with query_only set and verified on
every reader. Build with the with_* methods; the fields are private.
Implementations§
Source§impl ReadPoolOptions
impl ReadPoolOptions
pub fn new() -> Self
Sourcepub fn with_read_only(self, on: bool) -> Self
pub fn with_read_only(self, on: bool) -> Self
Opens each reader with SQLITE_OPEN_READ_ONLY, so writes fail even if query_only is later
turned off. The database must already exist: the pool never creates it, changes its journal
mode, narrows its permissions, or runs optimize. Each reader still runs the init hook,
as on the other connections. A rollback journal left by a crash is recovered by a writer,
not by a read-only reader. Default off.
Sourcepub fn with_reader_cache_kib(self, kib: u32) -> Self
pub fn with_reader_cache_kib(self, kib: u32) -> Self
Page cache size for each reader connection, in KiB. It is applied as PRAGMA cache_size
set to -kib, so the size does not depend on the page size. Valid values are 1 to
2147483647; the pool checks this when it opens. It overrides
CacheProfile::LargeWorkingSet on readers only. Writers and DbOptions::open_reader
keep the profile size. Default: the profile’s size.