Skip to main content

ensure_sqlite_memory_shared

Function ensure_sqlite_memory_shared 

Source
pub fn ensure_sqlite_memory_shared(
    config: &CamelConfig,
) -> Result<(), CamelError>
Expand description

Boot-time lint (ungated): rejects per-connection sqlite :memory: datasource URLs, which give every pooled connection its own private in-memory database — an INSERT through one connection and a SELECT through another can hit different databases. The fix is the shared cache (?cache=shared), which makes all connections in the process share one in-memory database.

Iterates config.datasources in BTreeMap order (the config stores a HashMap, whose iteration order is unspecified) so diagnostics are deterministic. The error names the datasource only, never its URL (ADR-0051 credential redaction).