Skip to content

Harden statement caching and resource handling - #56

Merged
quinnj merged 14 commits into
masterfrom
jq/interface-review
Aug 10, 2026
Merged

Harden statement caching and resource handling#56
quinnj merged 14 commits into
masterfrom
jq/interface-review

Conversation

@quinnj

@quinnj quinnj commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

This PR records a full correctness, performance, security, API, documentation, and open-issue review of DBInterface.jl.

  • Fixes connection and thread safety defects in @prepare.
  • Preserves named dictionary batches and established positional NamedTuple behavior in executemany.
  • Closes internally created statements and discarded cursors where their lifetime is bounded.
  • Preserves the primary transaction error when rollback also fails.
  • Adds scoped connect and prepare forms.
  • Clarifies SQL parameter safety, driver-specific placeholders, and cursor ownership.
  • Repairs current Documenter builds and updates CI and TagBot workflows.
  • Requires Julia 1.9 or later, as requested by the maintainer.

Commit list

  1. eb116a3 fixes macro hygiene, dynamic SQL, connection identity, and cache locking.
  2. c5b275b preserves named AbstractDict batches and closes bounded resources.
  3. b90218e preserves transaction and rollback failure context.
  4. 3624e54 adds scoped connection and statement forms.
  5. d6b328b displays interface error messages normally.
  6. 0620977 clarifies parameters, SQL safety, and resource ownership.
  7. e99fee3 repairs the docs build on current Documenter.
  8. a4b6568 updates workflows and includes the work proposed in Update TagBot config #53 and Update GitHub actions #54, with Max Horn credited in the commit.
  9. 786bfed skips transactions for empty bulk batches.
  10. f575491 retains downstream-compatible positional NamedTuple batches.
  11. 955962e raises the supported Julia floor to 1.9.
  12. e43c845 retains prepared statements across a bounded connection pool and closes changed SQL entries.
  13. 292df0d completes the AbstractDict contract for dictionary batch rows, which haskey-based drivers such as SQLite.jl and DuckDB.jl require.
  14. 3be366d bumps the package version to 2.7.0 for release.

Open issue review

Validation

  • DBInterface tests pass on Julia 1.9 and current Julia.
  • The threaded cache tests pass with four Julia threads.
  • Aqua passes all package checks.
  • Documenter 1.17 builds all docs and doctests.
  • SQLite 1.8.1 passes its full suite: 223 of 223 tests.
  • A live eight-connection, four-thread SQLite reproduction for DBInterface.@prepare is not threadsafe #51 and DBInterface.@prepare fails when used with multiple connections #52 passes.
  • DuckDB 1.5.5 passed its full upstream suite during the review.
  • MySQL, ODBC, LibPQ, DuckDB, and SQLite load without DBInterface method ambiguities.

Co-authored by Codex

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.78049% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.25%. Comparing base (5e13374) to head (3be366d).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/DBInterface.jl 98.78% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #56       +/-   ##
===========================================
+ Coverage    4.08%   82.25%   +78.17%     
===========================================
  Files           1        1               
  Lines          49      124       +75     
===========================================
+ Hits            2      102      +100     
+ Misses         47       22       -25     

☔ 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.

quinnj and others added 2 commits August 9, 2026 18:42
LazyNamedIndex subtypes AbstractDict but did not define Base.get, so
haskey, get, and key-membership checks raised MethodError. SQLite.jl and
DuckDB.jl bind named parameters through haskey, so executemany failed
for every AbstractDict batch. Define haskey and both get forms and test
them, verified against live SQLite and DuckDB inserts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quinnj
quinnj merged commit b2d89de into master Aug 10, 2026
9 checks passed
@quinnj
quinnj deleted the jq/interface-review branch August 10, 2026 01:15
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.

DBInterface.@prepare is not threadsafe

1 participant