node-pg-query
node-pg-query copied to clipboard
Allowing for own connection params with backwards compatibility
When used as default in an app (such as an express web app), you're only able to have one connection at a time. We've got a use case which would benefit from the ease of calling just the query interface but to have multiple connections possible.
This allows for a non-breaking usage with
query.connectionParameters = 'foo';
query.query('select * from bar');
But also extends the interface with
query.ownConnection('foo','select * from bar')