Skip to content

fix(odbc): populate the statement params and cache on the query path - #61

Merged
lovasoa merged 2 commits into
sqlpage:mainfrom
81reap:81reap/odbc-params-and-cache
Sep 28, 2026
Merged

lovasoa merged 2 commits into
sqlpage:mainfrom
81reap:81reap/odbc-params-and-cache

Conversation

@81reap

@81reap 81reap commented Sep 25, 2026 •

Copy link
Copy Markdown

Executor::fetch_many only ever read stmt_cache, so statement_cache_capacity and Execute::persistent() were empty and all queries ran through SQLExecDirect.

execute_stream cannot borrow &mut self, so prepared satements weren't processed correclty.

Now execute_steam is async and a query with arguments runs as a prepared statement, which fixes drivers taht ignore values bound before SQLExecDirect. Raw SQL still executes directly.

manual testing :: #57 (comment)

@81reap

This comment was marked as outdated.

@81reap
81reap force-pushed the 81reap/odbc-params-and-cache branch from d613ca0 to 48dd128 Compare September 25, 2026 05:14
@81reap 81reap changed the title fix(odbc): populate the statement cache on the query path fix(odbc): populate the statement params and cache on the query path Sep 25, 2026
@lovasoa

lovasoa commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

@81reap could you build sqlpage against this version of sqlx and try it against duckdb ? report if it works, if it's faster / slower.

I care about duckdb (which has actual sqlpage production users) more than gizmosql

@81reap

81reap commented Sep 25, 2026

Copy link
Copy Markdown
Author

yes, my clanker said that it did work this morning but I haven't personally tested it yet. Was gonna do that when I get home from work

`Executor::fetch_many` only ever read `stmt_cache`, so `statement_cache_capacity` and `Execute::persistent()` were empty and all queries ran through SQLExecDirect.

`execute_stream` cannot borrow `&mut self`, so prepared satements weren't processed correclty.

Now `execute_steam` is async and a query with arguments runs as a prepared statement, which fixes drivers taht ignore values bound before `SQLExecDirect`. Raw SQL still executes directly.
@lovasoa
lovasoa enabled auto-merge September 27, 2026 23:14
@lovasoa
lovasoa added this pull request to the merge queue Sep 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Sep 28, 2026
@lovasoa
lovasoa added this pull request to the merge queue Sep 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Sep 28, 2026
@lovasoa
lovasoa added this pull request to the merge queue Sep 28, 2026
Merged via the queue into sqlpage:main with commit 19a0971 Sep 28, 2026
27 checks passed
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.

2 participants