mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Connection Options for pool.getConnection

Open SReject opened this issue 5 years ago • 2 comments

Would be nice if we could specify various options specific to an acquired pool connection.

I'm specifically interested in debug, trace and multipleStatements though some of the encoding/formatting options would probably be welcome.

I understand the risk of multi-statements, but for my use case, its to setup the db on install so the risk is nil short of my own blunders.

Suggested format would be:

pool.getConnection([options], callback);

To be clear, these options would override the options specified when creating the pool and be for the specific connection returned by be the getConnection()

SReject avatar Mar 04 '19 16:03 SReject

yh I agree @SReject

marcus-hiles avatar Mar 08 '19 12:03 marcus-hiles

Sounds fine to me. PR welcome, of course. I will try to code the change at some point as well, but a PR will speed up when it will happen, haha. If you need a different option frequently it is likely better to use multiple pool, but I can see how this is useful for a single one off (like app init process or such).

dougwilson avatar Oct 04 '19 06:10 dougwilson