I have a little or no knowledge at how to properly implement postgres connection pool in node.js modules.
My question is : Is it problem when I am creating new Pool in every module where I need a connection to pg ?
Is there a way to create pool globally for a whole app ?
Thanks.
module.exports = new pg.Pool(config)
. Because of module caching, this will always return the same instance of the pool to each file thatrequire
's it. – Enchondroma