Skip to main content

materialize_changes_lineage

Function materialize_changes_lineage 

pub fn materialize_changes_lineage(db: &FactsDb) -> Result<()>
Expand description

Materialize changes_lineagechanges with path canonicalized via the rename-lineage map. Calls materialize_path_lineage first so the lookup table is in scope.

Built once per fact store: the view’s content is a pure function of the immutable changes / commits tables, so a per-FactsDb guard skips the recursive CTE + full table copy + index builds on every call after the first (12+ lineage-opt-in callers under --use-canonical-lineage otherwise each rebuilt it). apply_grouping’s in-place changes swap invalidates the guard so the post-grouping rebuild still happens exactly once.

Analyses that opt into rename-aware aggregation should FROM changes_lineage instead of FROM changes. The schema is identical modulo path being the post-rename canonical name.

§Errors

Returns CodeLoreError::Analysis on any SQL error.