brianc / node-pg-pool

A connection pool for node-postgres
MIT License
180 stars 64 forks source link

Adding support for `isDestroyed` function #59

Closed vitaly-t closed 7 years ago

vitaly-t commented 7 years ago

This can be done without reliance on the generic-pool, by introducing an internal flag to be set when .end() is called.

In this case the function can be replaced with a property, perhaps.

Anyway, this one will work just fine for the moment.

brianc commented 7 years ago

in pg-pool 2.0 you can check pool.ending to see if the pool is in the process of shutting down.

vitaly-t commented 7 years ago

Excellent! :) 👍

@brianc When can we expect this latest version of pg-pool to be used by the node-postgres? It is currently using version 1.*.

charmander commented 7 years ago

@vitaly-t pg-pool 2.x will be used in pg 7.x.

brianc commented 7 years ago

@vitaly-t - also the pool is backwards compatible with pg@5.x and pg@6.x - it's only going to be installed by default when installing pg@7.x because pg-pool@2.x drops support for node<4.x and has a few other minor backwards incompatibilities I tried to outline here: https://github.com/brianc/node-pg-pool/pull/67 ... but if you wanna use it or try it out right now it should work now.

I hope to be done with pg@7.x this weekend!