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

@@ -5,7 +5,7 @@ pkgbase=cthulhu-git
pkgname=cthulhu-git
_pkgname=cthulhu
pkgver=2026.10.31.r588.g9680b58
pkgrel=2
pkgrel=3
pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support"
url="https://git.stormux.org/storm/cthulhu"
arch=(x86_64 aarch64 armv7h)
@@ -45,6 +45,7 @@ optdepends=(
'git: Discover and update Tentacle repositories'
'tesseract: OCR engine for text recognition'
'tesseract-data-eng: English OCR language data'
'duckdb: DuckDB debug database logging with --debug-db'
)
optdepends_x86_64=(
# Wine accessibility helpers are supported on x86_64.
@@ -54,6 +55,8 @@ makedepends=(
git
go
pkgconf
# Headers only: libduckdb is dlopen'ed at runtime when --debug-db is used.
duckdb
)
options=(!debug !lto)
source=("${_pkgname}::git+https://git.stormux.org/storm/${_pkgname}.git#branch=master")
@@ -82,7 +85,7 @@ build() {
export GOCACHE="${GOCACHE:-${srcdir}/go-build}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -o build/cthulhu ./cmd/cthulhu
go build -tags duckdb -o build/cthulhu ./cmd/cthulhu
go build -tags brlapi -o build/cthulhu-braille ./cmd/cthulhu-braille
# Include the helper once incoming Remote keyboard support reaches master.
if [[ -d cmd/cthulhu-input-helper ]]; then
@@ -95,7 +98,7 @@ check() {
export CGO_ENABLED=1
export GOPATH="${srcdir}/go"
export GOCACHE="${GOCACHE:-${srcdir}/go-build}"
go test -tags brlapi ./... -count=1
go test -tags 'brlapi duckdb' ./... -count=1
}
package() {