avoid one-off prepared statements #16365
Unanswered
gdarbaidze
asked this question in
Help & Questions
Replies: 1 comment
-
It is fine to use bindParam for now. We plan on providing a way to specify which queries use bind parameters and which use replacements, but that is not currently implemented |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a problem with Sequelize(mysql dialect) and AWS RDS proxy.
The proxy gives logs like this:
The client session was pinned to the database connection [dbConnection=3372749374] for the remainder of the session. The proxy can't reuse this connection until the session ends. Reason: A protocol-level prepared statement was detected.
Meaning, that the proxy can't share connections, that execute prepared statements with other clients.
For some reason, Create method of a model generates prepared statements instead of injecting values into SQL query, which causes inefficient utilization of proxy's resources.
I discovered, that Sequelize have undocumented "bindParam" option, if you set bindParam: false in configuration, it starts to use value replacements instead of prepared statements.
But, it is safe to use "bindParam" for that?
Is there any safe way to avoid prepared statements?
Related issue:
#13972
Beta Was this translation helpful? Give feedback.
All reactions