Skip to content

2095 sqlite handler#4815

Open
peterfraedrich wants to merge 20 commits intotrufflesecurity:mainfrom
peterfraedrich:2095-sqlite-handler
Open

2095 sqlite handler#4815
peterfraedrich wants to merge 20 commits intotrufflesecurity:mainfrom
peterfraedrich:2095-sqlite-handler

Conversation

@peterfraedrich
Copy link
Contributor

@peterfraedrich peterfraedrich commented Mar 15, 2026

Adds sqlite database handler as requested in #2095

I can't find a more elegant way than copying the sqlite database to a new file; no sqlite drivers support opening a database from a Read/Write interface instead of a "real" file. That said, I tried to keep the costly operations at a minimum and chunk as small as possible (row).

Does not introduce any new test or lint failures.


Note

Medium Risk
Adds a new file-processing path that opens and queries SQLite databases (including temp-file writes) and introduces the modernc.org/sqlite dependency, which could affect performance and error handling on large/hostile DB inputs.

Overview
Adds first-class handling for SQLite database files (application/vnd.sqlite3). The new sqliteHandler copies the input to a temp file, opens it via modernc.org/sqlite, enumerates tables, and emits each row (YAML-serialized with a __table__ tag) through the existing chunking pipeline for scanning.

Updates handler selection to route SQLite MIME types to the new handler and adds a basic unit test validating the handler produces expected output counts. Dependency updates include adding modernc.org/sqlite (and its indirect deps) and bumping a few Go module versions (e.g., github.com/google/pprof, golang.org/x/exp, golang.org/x/tools).

Written by Cursor Bugbot for commit 7f4301a. This will update automatically on new commits. Configure here.

@peterfraedrich peterfraedrich requested a review from a team March 15, 2026 15:50
@peterfraedrich peterfraedrich requested review from a team as code owners March 15, 2026 15:50
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

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.

1 participant