Skip to main content

Module memo

Module memo 

Expand description

Process-local analysis memos, owned by the analyses layer.

These caches are keyed on analyses row/graph types, so they must not live on crate::facts::FactsDb — that would make the facts layer depend on analyses types, a genuine module cycle. Instead FactsDb holds one type-erased slot map (analysis_memo::<T>()); each memo below is a T that the analyses layer stores and retrieves through it, keyed per-FactsDb and shared for that connection’s lifetime.

Every memo stores the FULL, un-row-limited result: callers re-apply their own rows_limit after the lookup so a --rows N choice never poisons the shared entry. RefCell (not a Mutex) because the DuckDB Connection is !Send + !Sync and every analysis runs on the single connection-owning thread.