-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Can execute multiple statements in a single query #601
Comments
Unfortunately, the only way to support this at Slonik-level would be if we had a SQL tokenizer. I long wanted SQL tokenizer for other use cases, but there aren't any that have good enough coverage for production adoption. |
@alxndrsn another option to prevent this at Slonik level (assuming brianc/node-postgres#3214 does not get merged), would be to auto generate statement name based on the query. The overhead would be pretty minimal and it would achieve more or less the same effect as the proposed |
👍 but I suspect there is some extra overhead to named prepared statements vs unnamed. |
@alxndrsn I was going to update pg to allow |
Simple queries do not support parameters, so extended query mode is always when parameters are supplied. |
Released in v45.6.0. Thank you! |
Looks like the performance hit from enabling this is fairly substantive. Might may want to make this configurable. |
Expected Behavior
Attempting to run multiple statements should throw an Error, and the statement should not be executed.
Current Behavior
Attempting to run multiple statements should throw an Error, and the statements are executed.
Possible Solution
I think a fix would require a change in
node-postgres
to force use of extended queries when there is no prepared statement or query parameters.Steps to Reproduce
Logs
Passing test can be seen at:
The text was updated successfully, but these errors were encountered: