Skip to main content

install

Function install 

Source
pub fn install(
    capacity_bytes: u64,
    metrics: Option<Arc<dyn SqlitePoolMetrics>>,
) -> bool
Expand description

Installs the process-wide page cache with capacity_bytes, once per process.

It must run before anything else in the process uses SQLite, because SQLite accepts a page cache only before it initializes and sqlite3_config itself is not thread safe. Production calls it from the first SqlitePool::new, which runs at startup before any database opens. If SQLite is already initialized (another library opened a database first), the install fails and connections keep SQLite’s per-connection cache. Returns whether the process-wide cache is active. Later calls only attach metrics if none are attached yet.