| 782 | } |
| 783 | |
| 784 | func (p *Pool) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults { |
| 785 | c, err := p.Acquire(ctx) |
| 786 | if err != nil { |
| 787 | return errBatchResults{err: err} |
| 788 | } |
| 789 | |
| 790 | br := c.SendBatch(ctx, b) |
| 791 | return &poolBatchResults{br: br, c: c} |
| 792 | } |
| 793 | |
| 794 | // Begin acquires a connection from the [Pool] and starts a transaction. Unlike [database/sql], the context only affects the begin command. i.e. there is no |
| 795 | // auto-rollback on context cancellation. Begin initiates a transaction block without explicitly setting a transaction mode for the block (see [Pool.BeginTx] with [pgx.TxOptions] if transaction mode is required). |