Skip to content

[sqlite] Take DB path rather than opened database - #564

Merged
AlCutter merged 1 commit into
transparency-dev:mainfrom
AlCutter:sqlite_take_path
Jun 17, 2026
Merged

[sqlite] Take DB path rather than opened database#564
AlCutter merged 1 commit into
transparency-dev:mainfrom
AlCutter:sqlite_take_path

Conversation

@AlCutter

Copy link
Copy Markdown
Contributor

This PR makes the sqlite persistence c'tor use a path (via opts struct) to an sqlite DB file, rather than taking an opened DB.

The sqlite pragma options are important for the durability and correctness of the witness DB, so we shouldn't rely on the caller having correctly added them when opening a DB.

@AlCutter
AlCutter force-pushed the sqlite_take_path branch 3 times, most recently from 9cf8202 to ba5c9a7 Compare June 17, 2026 14:35
@AlCutter
AlCutter marked this pull request as ready for review June 17, 2026 14:35
@AlCutter
AlCutter requested a review from mhutchinson June 17, 2026 14:35
@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.30%. Comparing base (d94ec97) to head (e5bbea3).

Files with missing lines Patch % Lines
cmd/omniwitness/monolith.go 0.00% 4 Missing ⚠️
persistence/sqlite/sql.go 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #564      +/-   ##
==========================================
+ Coverage   24.98%   25.30%   +0.31%     
==========================================
  Files          27       27              
  Lines        2025     2035      +10     
==========================================
+ Hits          506      515       +9     
  Misses       1409     1409              
- Partials      110      111       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AlCutter
AlCutter merged commit 4eaf249 into transparency-dev:main Jun 17, 2026
13 checks passed
@AlCutter
AlCutter deleted the sqlite_take_path branch June 17, 2026 15:04
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.

3 participants