Diff fresh extraction against the database.
(
ctx: click.Context,
mode: str,
files: tuple[str, ...],
batch: int | None,
debug: bool,
)
| 930 | @click.argument("files", nargs=-1, required=True) |
| 931 | @click.pass_context |
| 932 | def diff_db_cmd( |
| 933 | ctx: click.Context, |
| 934 | mode: str, |
| 935 | files: tuple[str, ...], |
| 936 | batch: int | None, |
| 937 | debug: bool, |
| 938 | ) -> None: |
| 939 | """Diff fresh extraction against the database.""" |
| 940 | try: |
| 941 | parsed_mode, model = _parse_mode(mode) |
| 942 | except ValueError as e: |
| 943 | raise click.UsageError(str(e)) |
| 944 | |
| 945 | if batch is not None: |
| 946 | if batch < 1: |
| 947 | raise click.UsageError("--batch must be >= 1") |
| 948 | if not model: |
| 949 | raise click.UsageError( |
| 950 | "--batch requires a model (e.g. llm:gemini/<model>, llm:openai/<model>, or llm:azure/<deployment>)" |
| 951 | ) |
| 952 | if not model.startswith(_BATCH_MODEL_PREFIXES): |
| 953 | raise click.UsageError( |
| 954 | "--batch only supports gemini/, openai/, and azure/ models" |
| 955 | ) |
| 956 | |
| 957 | db_path = _require_db(ctx) |
| 958 | try: |
| 959 | gz_files = util.collect_gz_files(list(files)) |
| 960 | except ValueError as e: |
| 961 | raise click.UsageError(str(e)) |
| 962 | if not gz_files: |
| 963 | raise click.UsageError("No .gz files found.") |
| 964 | |
| 965 | run_dir: str = _ensure_run_dir(ctx) |
| 966 | s = store.Store.create(db_path) |
| 967 | t0 = time.monotonic() |
| 968 | batch_result = _run_diff_db( |
| 969 | gz_files, parsed_mode, model, run_dir, debug, s, batch_size=batch |
| 970 | ) |
| 971 | elapsed = time.monotonic() - t0 |
| 972 | rc = _log_summary(batch_result, 0, elapsed) |
| 973 | if rc != 0: |
| 974 | sys.exit(rc) |
| 975 | |
| 976 | |
| 977 | @diff.command("extractors") |
nothing calls this directly
no test coverage detected