Enhanced batch ingestion pipeline for loading MetaAST data into dllb.
Bridges MetaAST analysis output to dllb's storage layer by producing
batches of document and edge operations ready for bulk insertion.
Supports incremental re-indexing via Dllb.MetaAST.Diff.
Mirrors the Rust dllb-code-intel::ingest module with the same
deterministic ID scheme, enabling cross-language ID compatibility.
Usage
# Full ingest
batch = Dllb.MetaAST.Ingest.prepare_batch(tree, "lib/app.ex", "elixir")
queries = Dllb.MetaAST.Ingest.to_queries(batch)
Dllb.batch_transaction(queries)
# Incremental ingest (only changed entities)
diff = Dllb.MetaAST.Diff.diff_trees(old_tree, new_tree)
queries = Dllb.MetaAST.Ingest.incremental_queries(new_tree, diff, "lib/app.ex", "elixir")
Dllb.batch_transaction(queries)
Summary
Functions
Generate queries for incremental re-indexing based on a diff.
Merge multiple file batches into a single large batch for bulk loading.
Walk the MetaAST tree and produce a batch of dllb operations.
Convert a batch into dllb query strings wrapped in BEGIN/END BATCH.
Types
Functions
@spec incremental_queries( tuple(), Dllb.MetaAST.Diff.diff_summary(), String.t(), String.t() ) :: [ String.t() ]
Generate queries for incremental re-indexing based on a diff.
Only produces operations for changed entities:
- DELETE + CREATE for modified/added entities
- DELETE for removed entities
Merge multiple file batches into a single large batch for bulk loading.
Walk the MetaAST tree and produce a batch of dllb operations.
Produces:
- A document for each Container and FunctionDef node
- Containment edges: container -> contains -> function
- Import edges: container -> imports -> (stable ID)
- Call edges: function -> calls -> (stable ID)
Convert a batch into dllb query strings wrapped in BEGIN/END BATCH.