mix dllb.ingest (Dllb v0.4.0)

Copy Markdown View Source

Ingests source code files into the dllb database as MetaAST nodes and edges.

Parses source files using Metastatic, converts them to dllb documents, and stores them as ast_node records with structural relationship edges (contains, calls, imports).

Usage

mix dllb.ingest PATH [PATH...] [OPTIONS]

Arguments

  • PATH -- One or more files or directories to ingest. Directories are walked recursively. Only files with recognized extensions are selected. Defaults to lib/ when no paths are given.

Options

  • --language LANG -- Force a language for all files instead of auto-detecting from extensions. One of: elixir, erlang, python, ruby, haskell.
  • --project-path NAME -- Project identifier stored in the project_path field of every ingested node. Useful for multi-project indexes.
  • --batch-size N -- Number of queries per batch send (default 100).
  • --bootstrap -- Create the dllb schema (DEFINE TABLE / FIELD / INDEX) before ingesting. Safe to run repeatedly.
  • --clean -- Delete existing ast_node records for each file before re-ingesting. Use this for a full refresh of already-ingested files.
  • --dry-run -- Discover files and print a summary without executing any queries.
  • --exclude PATTERN -- Glob pattern to exclude. May be repeated. Directories _build, .git, .elixir_ls, .lexical, and .dialyzer are always excluded.

Supported extensions

ExtensionLanguage
.ex .exselixir
.erl .hrlerlang
.pypython
.rbruby
.hshaskell

Examples

Ingest a project's lib directory:

mix dllb.ingest lib/

Ingest with schema bootstrap and project tag:

mix dllb.ingest lib/ --bootstrap --project-path my_app

Also ingest dependency source code:

mix dllb.ingest lib/ deps/ --bootstrap --project-path my_app

Re-ingest a single file, cleaning stale data first:

mix dllb.ingest lib/my_app/parser.ex --clean

Dry run to preview what would be ingested:

mix dllb.ingest lib/ deps/ --dry-run

Exclude test and support files:

mix dllb.ingest . --exclude "test/**" --exclude "priv/**"