Repository navigation
Accept strict and allowduplicates in every DBInterface.execute form - #379
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DBInterface's connection and callback forms of execute take no keywords, and its keyword-only forms bind every keyword as a named parameter. So DBInterface.execute(db, sql; strict=true) bound an unused parameter named strict and returned a non-strict query, and the forms with explicit params threw a MethodError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #379 +/- ##
==========================================
+ Coverage 96.81% 96.89% +0.08%
==========================================
Files 5 5
Lines 785 806 +21
==========================================
+ Hits 760 781 +21
Misses 25 25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
strictandallowduplicatesworked only in one form,DBInterface.execute(stmt, params; strict=true). The obvious call,DBInterface.execute(db, sql; strict=true), returned a normal non-strict query with no error, because DBInterface binds every keyword of that form as a named SQL parameter, and SQLite ignores parameters with no matching placeholder. With explicit params,DBInterface.execute(db, sql, params; strict=true)threw aMethodError. The do-block forms behaved the same way.What changed
DBInterface.executeon aSQLite.DBorSQLite.Stmttakesstrictandallowduplicatesin all eight forms: with or withoutparams, and with or without a callbackf.params, every other keyword is still bound as a named parameter.allowduplicates, which had no docs.Scope
:strictor:allowduplicatescan no longer be bound by keyword in the forms withoutparams. Pass it in aNamedTupleinstead.DBInterface.executemultiplestill takes no options.Blast Radius
Every
DBInterface.executecall on SQLite now goes through SQLite's own methods instead of DBInterface's generic ones. They do the same prepare, execute, and close-on-error steps. Inferred return types match master for every form, andTest.detect_ambiguities(SQLite, DBInterface)is empty.Verification
Every execute form takes strict and allowduplicates. On master: 1 pass, 4 fails (([:a, :a_1], nothing, 1) == ([:a, :a], Tables.Schema(...), 1), the options silently dropped), and 3MethodErrors. On this branch: 8/8.Pkg.test()passes on Julia 1.12 and 1.10 (531/531).🤖 Generated with Claude Code