Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Non-async pgwire.connect() version #15

Closed
dko-slapdash opened this issue Dec 24, 2019 · 1 comment
Closed

Feature request: Non-async pgwire.connect() version #15

dko-slapdash opened this issue Dec 24, 2019 · 1 comment

Comments

@dko-slapdash
Copy link

Currently, one has to await on pgwire.connect() (because it returns a Promise). This makes it impossible to be called in e.g. constructor of some other class, so I have to do the following hack:

const Connection = require("pgwire/lib/connection");
...
constructor(...) {
  this.connection = new Connection({...});
}

I notices that pgwire.pool() does NOT required awaiting, and this is very convenient. I'd use pgwire.pool() everywhere instead of the above example, but unfortunately Pool doesn't allow to create new connections (see #14 for more details).

@exe-dealer
Copy link
Member

synchronous pgconnection is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants