Module ingest
Expand description
Stream commits from a Repo into DuckDB via the
N gix workers → bounded crossbeam channel → 1 Appender thread pattern.
See spec §3.2.2.
Threading model: duckdb::Connection contains RefCell, which is !Sync.
Therefore &FactsDb is !Send and the Appender must run on the thread that
owns the FactsDb. We flip the design: the producer runs in a scoped
spawned thread (Repo is Send + Sync) and the consumer (Appender) runs
on the calling thread.
Re-exports§
pub use at_rev::ingest_complexity_at_rev;pub use at_rev::materialize_imports_at_rev;
Modules§
- at_rev
- Rev-parameterized ingest helpers. Materializes complexity metrics and
import-graph edges for an arbitrary revision into caller-named temporary
tables, enabling the health timeline to build a
HealthScanCtxthat points at historical data instead of the HEAD tables.
Structs§
Functions§
- apply_
grouping - Apply architectural grouping in-place on the
changestable. Called byFactsDb::ingestafter raw ingest ifopts.group_file.is_some(). - materialize_
changes_ bucketed - Materialize a session-temporary
changes_bucketedtable that collapses commits within the samedate_trunc(<bucket>, commit.date)window into a single logical “commit” per (bucket, path). Coupling-family analyses (coupling,clone-couplingindirectly,soc) query this table whenopts.time_bucket.is_some()so commits landed across the same day/week/month count as one for pair-counting purposes. - materialize_
changes_ lineage - Materialize
changes_lineage—changeswithpathcanonicalized via the rename-lineage map. Callsmaterialize_path_lineagefirst so the lookup table is in scope. - materialize_
path_ lineage - Materialize the rename-lineage map as a temporary table.
- set_
channel_ capacity_ override - Bench hook: set the channel-capacity override for subsequent
ingest()calls. Pass0to restore the default. Exists so V6’singest_capacity_sweepbench can vary the bound across[16, 64, 256, 1024]in onecargo benchinvocation —unsafe { env::set_var }would violate the workspaceunsafe_code = "forbid"lint and acfg(test)gate wouldn’t fire incargo bench.