ncthbrt / nact-persistence-postgres

Postgre Storage Provider for Nact
Apache License 2.0
14 stars 8 forks source link

Allow PostgresPersistenceEngine() to accept a pgp connection as an alternative to a connectionString #8

Closed ellis closed 5 years ago

ellis commented 5 years ago

Could you allow the user to pass an already constructed pgp database to the constructor of PostgresPersistenceEngine, as an alternative to a connection string? The use case is two-fold:

  1. I need to connect to a postgres database with some complex SSL options that I can't pack into the connection string.
  2. My program needs to query the postgres database apart from Nact, so I keep getting warnings about having multiple connections open.
ncthbrt commented 5 years ago

I can certainly add support for that.

On Wed, 29 May 2019, 20:30 Ellis Whitehead, notifications@github.com wrote:

Could you allow the user to pass an already constructed pgp database to the constructor of PostgresPersistenceEngine, as an alternative to a connection string? The use case is two-fold:

  1. I need to connect to a postgres database with some complex SSL options that I can't pack into the connection string.
  2. My program needs to query the postgres database apart from Nact, so I keep getting warnings about having multiple connections open.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ncthbrt/nact-persistence-postgres/issues/8?email_source=notifications&email_token=ACCJEWOU52DHBPYJLOWPMD3PX3DUXA5CNFSM4HQQIPYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWRZ5AA, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCJEWN2KF6MMPTLZICWVDLPX3DUXANCNFSM4HQQIPYA .

ncthbrt commented 5 years ago

@ellis Will let you know when I've got a PR available for this.

ncthbrt commented 5 years ago

@ellis I've pushed version v7.3.1 to npm Please let me know if you encounter any problems with the implementation of your request.

ellis commented 5 years ago

Thanks, @ncthbrt, works great!