You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Successful writer sessions attempt `PRAGMA wal_checkpoint(TRUNCATE)` before closing a writable `DbContext`, so large WAL files are reclaimed after index, backfill, optimize, prune, and other DB-writing commands. `cdidx db schema [--json]` dumps `sqlite_master` entries plus `PRAGMA user_version` for schema inspection, and `cdidx db prune --dry-run|--apply [--json]` counts or deletes orphaned `symbol_references`, `reference_lines`, and `symbols` rows before running `PRAGMA optimize` on apply.
159
159
160
+
### Metadata invariants
161
+
162
+
`DbWriter.SetMeta` participates in the caller's writer transaction when one is
163
+
active. When no writer transaction is active, it wraps the metadata UPSERT in a
164
+
SQLite savepoint so standalone stamps still have a commit boundary and calls
165
+
from raw SQL transactions do not attempt a nested `BEGIN`. Dependent metadata
166
+
and row rewrites that must succeed or fail together should be placed inside the
167
+
same `DbWriter.BeginTransaction()` scope; do not stamp readiness or schema
168
+
trust metadata before the dependent rows are written.
169
+
160
170
### Extending the indexer
161
171
162
172
Out-of-tree post-extraction hooks can implement `CodeIndex.Indexer.Hooks.IPostExtractionHook` in a `.dll` placed under `~/.config/cdidx/hooks/` (or the directory named by `CDIDX_HOOKS_DIR`). Hook assemblies are discovered in path order. Each concrete hook type is instantiated with a public parameterless constructor, then called after built-in symbol extraction and again after built-in reference extraction, before rows are persisted. Hooks receive a `FileContext` plus mutable `IList<SymbolRecord>` / `IList<ReferenceRecord>` values, so they can annotate extracted records, add synthetic symbols, or add domain-specific references.
-**Made metadata stamps participate in transaction boundaries (#1753)** — `SetMeta` now joins writer transactions or uses a SQLite savepoint for standalone writes so metadata and dependent rows can roll back together.
0 commit comments