Add optional DuckDB debug log database with typed schema

New --debug-db flag writes the redacted debug record stream to a DuckDB database alongside or instead of the NDJSON --debug-file. Frequent type-stable attributes are promoted to typed columns; the complete record remains in attrs JSON. libduckdb is dlopen'ed at runtime (build tag duckdb, Arch optdepends) so the reader runs unchanged without it. v1 databases upgrade in place on append.
This commit is contained in:
hjozwiak committed 2026-11-10 21:13:41 -05:00
1 parent 64f60fe4e8
commit b03cb8917d
14 files changed
+1906 -14

No files matched your search

+2
View File
@@ -22,10 +22,12 @@ Use Go 1.24+ with CGO and development libraries listed by the Arch `PKGBUILD`.
- `go build -o build/cthulhu ./cmd/cthulhu`: build the reader.
- `go build -tags brlapi -o build/cthulhu-braille ./cmd/cthulhu-braille`: build the Braille helper.
- `go build -tags duckdb -o build/cthulhu ./cmd/cthulhu`: build the reader with `--debug-db` DuckDB debug-log support (needs duckdb headers at build time only; libduckdb is dlopen'ed at runtime and is an optional package dependency; test with `go test -tags duckdb ./internal/logging/ ./cmd/cthulhu/`).
- `go build -o build/cthulhu-input-helper ./cmd/cthulhu-input-helper`: build the remote input helper; install it beside the reader for incoming keyboard control.
- `go test ./... -count=1`: run default tests; native cases may skip.
- `go test -tags brlapi ./... -count=1`: run packaging checks.
- `go vet ./...`: check common Go errors.
- `golangci-lint run ./...`: run the configured lint gate (`.golangci.yml`, v2 schema; build tags brlapi/duckdb set there; keep the linter built with a Go at least as new as the project toolchain or it reports typecheck garbage).
- `go run ./cmd/parityledger validate testdata/parity-ledger.csv`: validate parity records.
- `./build/cthulhu --check-config`: validate settings; `./build/cthulhu` starts the reader.