brianc / node-pg-pool

A connection pool for node-postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pool.end() needs to process pending queries

opened this issue · comments

pool.end() processes the queries in the active connections but then drops all other pending queries, there really needs to be an option to also process all pending queries or end() needs to be changed to finish pending queries before shutting down. Other libraries like the mongodb-node driver finish pending queries with the close() method rather than drop pending queries. Users most likely want queries to finish after queuing them up and get a callback for when those are done

For what it is worth, I have implemented this functionality in Slonik.

https://github.com/gajus/slonik#slonik-usage-end-connection-pool

Of course, the majority of the work is still done by pg-pool. Slonik simply enables this functionality by patching pg-pool.