-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Right now, whether you can send multiple statement queries is determined at connection/pool creation time.
I understand this is done for security's sake, and yet it seems this is one of those cases where the alternative - creating a separate connection/pool for when you need to use multiple queries - is only creating more issues than it is solving... Case in point being the under or over utilization of the MySQL server's connection limit.
It would be much better if multiple queries can be opted into at the time of the method call. Opt in so that security is not compromised.
So, either a separate method (e.g. multiQuery("LOCK TABLES t; INSERT INTO t ?;UNLOCK TABLES", o, cb)
) on connections and pools, or an option in the query object (e.g. query({multipleStatements: true, sql: "LOCK TABLES t; INSERT INTO t ?;UNLOCK TABLES"}, o, cb)
).