Hi,
Is there a way to suppress (or better yet fix) the following warning:
WARNING: Creating a duplicate database object for the same connection
I have an express application which initializes pg-promise on start and calls pgp.end() when the application
exits.
I am starting/stopping my app in a series of mocha tests and I get this warning even though I call pgp.end().
Any ideas what I might be doing wrong here?
@blendsdk you should follow this pattern: http://stackoverflow.com/questions/34382796/where-should-i-initialize-pg-promise
and initialize your database object only once per connection, and then share it.
Most helpful comment
@blendsdk you should follow this pattern: http://stackoverflow.com/questions/34382796/where-should-i-initialize-pg-promise
and initialize your database object only once per connection, and then share it.