Skip to content

Close internally prepared statements when execution fails - #60

Merged
quinnj merged 1 commit into
masterfrom
fix/dbinterface-lifecycle
Sep 23, 2026
Merged

quinnj merged 1 commit into
masterfrom
fix/dbinterface-lifecycle

Conversation

@quinnj

@quinnj quinnj commented Sep 22, 2026

Copy link
Copy Markdown
Member

The generic execute(connection, sql, params) and executemultiple(connection, sql, params) helpers prepare a statement internally. If execution then throws before returning a cursor, that statement was left open.

Close the internally prepared statement on that failure path and rethrow. Successful results retain their existing lifetime, and explicitly supplied statements remain caller-owned. Document this ownership rule. Driver-specific connection overrides and failures while consuming a returned cursor remain outside these generic helpers.

Validation: two new cleanup assertions failed before the fix. All ten ownership assertions now pass, including successful-result and caller-owned-statement controls. Full package suites pass on Julia 1.9.4 and 1.12.6 with four threads. The regression uses the existing fake driver; no production leak measurement is claimed.

Co-authored by Codex

@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.92%. Comparing base (53901ea) to head (9f6643d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   82.40%   85.92%   +3.52%     
==========================================
  Files           1        1              
  Lines         125      135      +10     
==========================================
+ Hits          103      116      +13     
+ Misses         22       19       -3     

☔ 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 merged commit 4b68a9f into master Sep 23, 2026
9 checks passed
@quinnj
quinnj deleted the fix/dbinterface-lifecycle branch September 23, 2026 01:11
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