-
-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to EXPLAIN a query with parameters #1243
Comments
I just played around with it a bit, also in a C++ application using the same functions. It looks like that a prepared statement really requires the parameters to be bound, even if you just want to use explain. That would not be a pure better-sqlite3 problem. It might be a shortcoming that there is no way of just executing a statement and fetch the result, but maybe I am missing something :-/ |
Note that it works with the built-in |
@merceyz thanks for taking the time to describe this issue. This feels arguably like a feature request, not a bug--I would have expected the clause to require bound parameters. @JoshuaWise feel free to re-open if you think this should be entertained. |
I think this is a legitimate use-case, and it currently doesn't work as a result of I wonder what the best way to solve this is. Two options that come to mind:
|
Running EXPLAIN on a query that contains parameters doesn't seem to work correctly as an error is thrown because the parameters aren't set but that shouldn't be required.
Tested with better-sqlite3 v11.2.1 and Node.js v18.20.4.
Reproduction:
Error:
The text was updated successfully, but these errors were encountered: