-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Does this library supports binary_parameters ? #2266
Comments
The It might just work with node-postgres as-is, have you tried it? |
I've read somewhere that |
Having something like this might allow |
|
The node-postgres implementation is single round-trip. |
I'm going to attempt to get transaction pooling working with node-postgres and |
Yes, the parameterized queries are usually unnamed prepared statements. The library creates a prepared statement, binds the parameters and exeutes it in a single step. |
@boromisp It looks like on node-postgres/packages/pg/lib/query.js Line 54 in 95b5daa
|
If you follow the implementation of node-postgres/packages/pg/lib/query.js Line 180 in 95b5daa
you can see that it doesn't wait for a response between messages, but prepares the statement, binds the parameters and executes the query synchronously. I assume that this counts as a single round-trip. Whether or not it is compatible with transaction pooling I haven't tested. |
@lastmjs any luck on this your efforts? |
It did not work. It's been a few weeks now, so I'm a bit foggy on the details. I tried session and transaction pooling with pgBouncer, and though requests were handled just fine, the pool did not act as a pool. I saw no reason to believe it was providing any kind of benefit over connecting without the pool. |
Hi,
I would like to use this package with pgBouncer in transaction mode but it seems that if I will try to use prepared statements it won't work, while I am ok with that (simply not use prepared statements), there are additional packages that use this library (https://github.com/graphile/worker for example), and they are using prepared statements, and therefor won't work correctly. If I understand correctly, supporting binary_parameters will allow this library, pgBouncer and prepared statements to play along.
Also, it seems like a nice performance improvement.
The text was updated successfully, but these errors were encountered: