Skip to content

feat: add DuckDB as default database backend with SQLite fallback#298

Open
nishikawaakira wants to merge 5 commits intomainfrom
feature/duckdb-backend
Open

feat: add DuckDB as default database backend with SQLite fallback#298
nishikawaakira wants to merge 5 commits intomainfrom
feature/duckdb-backend

Conversation

@nishikawaakira
Copy link
Collaborator

Add DuckDB as the default database backend for html-report and html-server commands, with --sqlite flag to use SQLite as a fallback. DuckDB provides 4-24x faster analytical queries and ~7x smaller file sizes.

  • Add dbAdapter.nim with direct C FFI bindings to DuckDB
  • Add --sqlite flag and --dboutput parameter to CLI
  • Migrate all controllers and report generators to use dbAdapter
  • Handle SQL dialect differences (GROUP BY strictness, date functions, DDL)

Add DuckDB as the default database backend for html-report and html-server
commands, with --sqlite flag to use SQLite as a fallback. DuckDB provides
4-24x faster analytical queries and ~7x smaller file sizes.

- Add dbAdapter.nim with direct C FFI bindings to DuckDB
- Add --sqlite flag and --dboutput parameter to CLI
- Migrate all controllers and report generators to use dbAdapter
- Handle SQL dialect differences (GROUP BY strictness, date functions, DDL)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nishikawaakira nishikawaakira requested review from YamatoSecurity and fukusuket and removed request for fukusuket February 22, 2026 04:20
Copy link
Collaborator

@fukusuket fukusuket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nishikawaakira
Great idea to use DuckDB for speeding things up! Just one thing to confirm: DuckDB is required for both building and running takajo. Is this the intended behavior?

Building(without duckdb):

Running(without duckdb):

./takajo html-server -t ../hayabusa-3.8.0-mac-aarch64/timeline.jsonl
dyld[19627]: Library not loaded: /opt/homebrew/opt/duckdb/lib/libduckdb.dylib
  Referenced from: <EB979A90-94F3-3B0F-93B2-83D517E384F7> /Users/fukusuke/YamatoSecurity/takajo-2.15.1-mac-aarch64/takajo
  Reason: tried: '/opt/homebrew/opt/duckdb/lib/libduckdb.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/duckdb/lib/libduckdb.dylib' (no such file), '/opt/homebrew/opt/duckdb/lib/libduckdb.dylib' (no such file)
zsh: abort      ./takajo html-server -t ../hayabusa-3.8.0-mac-aarch64/timeline.jsonl

I’ve confirmed that running brew install duckdb on macOS resolves both errors.

Update both English and Japanese READMEs to document DuckDB as the
default database backend for html-report/html-server commands, including
installation instructions for macOS/Windows/Linux and the --sqlite
fallback option.
@nishikawaakira
Copy link
Collaborator Author

@fukusuket
Thanks for confirming! Yes, DuckDB is currently required for both building and running the html-report/html-server commands. This is the intended behavior.

I've updated both READMEs (ef4fcb3) with DuckDB installation instructions for macOS/Windows/Linux and documentation for the --sqlite option.

@fukusuket
Copy link
Collaborator

@nishikawaakira Thank you for updating the README! LGTM!!🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants