Skip to content

Enable multiple and single statement queries on the same connection #1806

@boenrobot

Description

@boenrobot

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)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions