node-pg-query icon indicating copy to clipboard operation
node-pg-query copied to clipboard

Factory instead of singleton

Open rt2zz opened this issue 10 years ago • 1 comments

do not merge

This changes it to export a factory function instead of a singleton. I needed this to have two seperate connections open. What are your thoughts? The api could probably be massaged to be backwards compatible if you are interested in this approach.

rt2zz avatar Sep 17 '15 23:09 rt2zz

I dig that. Singleton is no bueno

If you wanna keep it backwards compat thats cool - i do generally include this module directly in a dew files so would be a pita to change everything.

Otherwise we can bump the major version. :)

On Thursday, September 17, 2015, Zack [email protected] wrote:

do not merge

This changes it to export a factory function instead of a singleton. I needed this to have two seperate connections open. What are your thoughts? The api could probably be massaged to be backwards compatible if you are

interested in this approach.

You can view, comment on, or merge this pull request online at:

https://github.com/brianc/node-pg-query/pull/11 Commit Summary

  • Class instead of singleton

File Changes

  • M index.js https://github.com/brianc/node-pg-query/pull/11/files#diff-0 (22)

Patch Links:

  • https://github.com/brianc/node-pg-query/pull/11.patch
  • https://github.com/brianc/node-pg-query/pull/11.diff

— Reply to this email directly or view it on GitHub https://github.com/brianc/node-pg-query/pull/11.

brianc avatar Sep 18 '15 00:09 brianc