-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
connect function is returning undefined #57
Comments
Hey @tiitremmel. Fair enough. I don't think there was any particular reason. Be aware, however, that this db connection is managed by So I would not recommend re-purposing that connection for anything else. Also seems rather unclean in terms of separation of concern. I don't think that one additional connection to the DB will have any significant impact on resource usage 😉 |
I'm also planning to use it but for a different reason. In some cases I want to run |
@andywer you seam to have a mind for the async code. I'm thinking one use-case (probably the most common) is to establish LISTEN then, when relying on the data from LISTEN, use the client to start a request and save the promise (from |
pg-listen/src/index.ts
Lines 302 to 306 in 7dec032
Is there any reason why
connect()
is returning undefined notdbClient
? Just wondering because I need to query db also and it doesn't make sense to create another connection to db. Whenconnect()
function would returndbClient
it would be possible.The text was updated successfully, but these errors were encountered: