-
Notifications
You must be signed in to change notification settings - Fork 802
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: Support for pgx batching #1275
Comments
#1352 could at least alleviate the inserting part of this, but CopyFrom can't do everything regular inserts can do. |
For what it's worth, I recently migrated some code from "one insert at a time" to "1000 inserts in a batch" and got at least 100x speedup (it's now so fast I don't care). As a result, I more-or-less can't use sqlc in my project, even though I'd like to. |
As far as I understand, currently there is still no support for batching different kinds of queries, is there? This would be really handy, as it's going to reduce the number of roundtrips for complex queries. |
As mentioned in #472,
pgx
batching can be a very important tool for efficient inserts and queries. There doesn't seem to be any way to use the generated methods with the existingpgx
batching interface. Thepgx
batching interface is defined by the Batch type and its Queue method. It would be neat if we could have something similar to the generatedNew(db DBTX) *Queries
function that operates on apgx.Batch
.We'd need to think a little about the design, since in an ideal world we'd still be able to get typed responses for each entry on the batch. Maybe each function on the type that operates on a batch should take a callback or something for how to process the returned data?
The text was updated successfully, but these errors were encountered: