Skip to content

Support direct DBInterface parameter binding - #242

Merged
quinnj merged 1 commit into
mainfrom
codex/issue-238-direct-execute
Aug 2, 2026
Merged

Support direct DBInterface parameter binding#242
quinnj merged 1 commit into
mainfrom
codex/issue-238-direct-execute

Conversation

@quinnj

@quinnj quinnj commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • support DBInterface.execute(conn, sql, params) by preparing the statement for one execution
  • retain the temporary statement on the returned cursor so bind buffers and the C handle remain valid through result consumption and explicit close
  • add MySQL integration coverage for DML, nothing, last-row IDs, buffered and streaming reads, garbage collection, and date/time conversion

Root cause

MySQL.jl overrode DBInterface's connection-level fallback and explicitly rejected every non-empty parameter set, even though the package documentation described the call as supported. Calling the prepared-statement path alone was not sufficient because the returned cursor can outlive the convenience call. The cursor now owns the temporary statement for that lifetime.

Impact

Portable DBInterface code can use the same connection-level parameterized execution form with MySQL.jl, SQLite.jl, and Postgres.jl. Callers that execute the same SQL repeatedly should still use DBInterface.prepare to reuse the statement.

This completes the remaining behavior from #238. PR #239 already fixed nothing binding and transaction return values.

Validation

  • focused issue reproduction passed against MySQL 8
  • full suite passed on Julia 1.12.6: 217 tests
  • full suite passed on Julia 1.10.11: 217 tests
  • documentation build passed
  • git diff --check passed

Closes #238

Co-authored by Codex

Prepare connection-level parameterized queries for one execution. Retain the temporary statement on the returned cursor so its bind buffers and C handle stay valid through result consumption and explicit close.

Add regression coverage for DML, NULL values, last-row IDs, buffered and streaming results, garbage collection, and date/time conversion.
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.68%. Comparing base (6144a81) to head (8103c44).

Files with missing lines Patch % Lines
src/prepare.jl 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #242      +/-   ##
==========================================
+ Coverage   71.50%   71.68%   +0.17%     
==========================================
  Files          10       10              
  Lines        1260     1275      +15     
==========================================
+ Hits          901      914      +13     
- Misses        359      361       +2     

☔ 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
quinnj marked this pull request as ready for review August 2, 2026 05:56
@quinnj
quinnj merged commit 0db64b5 into main Aug 2, 2026
6 checks passed
@quinnj
quinnj deleted the codex/issue-238-direct-execute branch August 2, 2026 05:56
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.

Three DBInterface behaviors that differ from SQLite.jl and Postgres.jl (transaction return value is a bug)

1 participant