Charmander

Results 205 comments of Charmander

Use `pool.query` and [Bluebird resource management][1]. [1]: http://bluebirdjs.com/docs/api/resource-management.html

Sorry, to be specific: they’re for the two different cases. ```js pg.Pool.prototype.connectResource = function () { return this.connect().disposer(function (client) { client.release(); }); }; ``` ```js function singleQuery(db, input) { return...

> It's that if you're interested in holding a connection from the pool for the right reasons Which reasons?

> Maybe I want to run 500 separate transactions in series and don't want to incur the overhead of constantly releasing/acquiring a connection from the pool? You might be overestimating...

(To be clear, I’m not against this being implemented; extra safety is always nice. I do think any instances of this problem are indicative of questionable design on the user’s...

> No matter what we change the values of the last 5 items to (I added the last 2 after no love on the idleTimeoutMills by itself) there is always...

Please show the script you’re running, not pg-pool’s source. `log` is set here: https://github.com/brianc/node-pg-pool/blob/4d7734a71122cbbe1bb81bb466430e96f3405394/index.js#L67

Event listeners are called synchronously by `emit`, and the pool emits `connect` on a client before the client is used, so if the listener makes a query immediately (like here)...

@claytongulick A client can only run one query at a time, so pg keeps a queue of queries for each client. If the query is first to enter the queue,...

@mathroc What is it that you need to do every time a connection is acquired?