use await with pgPromise connections sometimes produces unexpected bahvious #836
jonseymour
started this conversation in
General
Replies: 1 comment
-
Ok, upgrading to 10.11.1 fixes this - I now get an error message as expected. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem Statement
I am getting unexpected behaviour when attempting to use a pg-promise connection with an await statement and I don't understand why.
The connection is allocated ok, but an attempt to call query() on returned connection fails without returning a result or throwing an error.. AFAICT the thread of control never returns to the invoking function.
Can anyone explain what is going on?
update: eventually narrowed it down to a faulty connection string
url=postgres://pguser:foobar@dbhost:5432/non-existent-database
Once I corrected the database name in the connection string, everything worked as expected.
However, that doesn't explain why the pgp call worked, but the subsequent calls failed without trace with emphasis on the words without trace
Expected behaviour
output as either:
obtained db
have result
<program exits>
or
obtained db
have error
<program exits>
Actual behavior
obtained db
<program exits>
Steps to reproduce
Environment
Beta Was this translation helpful? Give feedback.
All reactions