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

Open
dko-slapdash opened this issue Dec 24, 2019 · 0 comments
Open

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

dko-slapdash opened this issue Dec 24, 2019 · 0 comments

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).

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

1 participant