Closed lenemson closed 7 years ago
This PR could be part of it: https://github.com/brianc/node-pg-pool/pull/59
as it does the same, specifically for one flag.
generic pool has been removed as a dependency, so all the getters are now directly on pool
and anything documented is considered part of the public API and wont be changing between major versions. So...yay! 💃
If you or your company benefit from node-postgres and have the means, please consider supporting my work on Patreon.
If one needs to access pool state (total size, available objects and in use objects) it has to access the genericPool getters like this:
While it works it is a bit risky cause
pool.pool
is an internalgeneric-pool 2.4.3
instance thus we have no control to whengeneric-pool
will be updated and when the api will break, and it will break becausegeneric-pool 3
's getters has been renamed.So I suggest with this PR to add
pg-pool
getters that wrapgeneric-pool
getters in order to safely access the pool state, Whenpg-pool
will update his version of 'generic-pool' we will just need to update thepg-pool
getters to use the new names of thegeneric-pool
getters and it will be transparent with no breaking changes for the users.