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

added BatchExec and BatchExecTx func #2266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nar10z
Copy link

@nar10z nar10z commented Feb 26, 2025

Hey, everybody!
I decided to add 2 new functions to simplify working with pgx.Batch{}.
One can be executed with both pgx.Conn and pgx.Tx. The second one is executed only with pgx.Conn, but specifies the transaction explicitly.

@jackc
Copy link
Owner

jackc commented Mar 1, 2025

I don't understand how this should be used.

BatchExec appears to do the same thing as:

err := SendBatch(batch).Close()

And batches are already implicitly transactional, so I'm not sure when BatchExecTx would be used.

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

Successfully merging this pull request may close these issues.

2 participants