mirror of https://github.com/jackc/pgx.git
Add docs regarding closing BatchResults
parent
9d3a4b5736
commit
e16bfa9af5
5
batch.go
5
batch.go
|
@ -36,8 +36,9 @@ type BatchResults interface {
|
|||
// QueryRow reads the results from the next query in the batch as if the query has been sent with Conn.QueryRow.
|
||||
QueryRow() Row
|
||||
|
||||
// Close closes the batch operation. Any error that occurred during a batch operation may have made it impossible to
|
||||
// resyncronize the connection with the server. In this case the underlying connection will have been closed.
|
||||
// Close closes the batch operation. This must be called before the underlying connection can be used again. Any error
|
||||
// that occurred during a batch operation may have made it impossible to resyncronize the connection with the server.
|
||||
// In this case the underlying connection will have been closed.
|
||||
Close() error
|
||||
}
|
||||
|
||||
|
|
3
conn.go
3
conn.go
|
@ -685,7 +685,8 @@ func (c *Conn) QueryRow(ctx context.Context, sql string, args ...interface{}) Ro
|
|||
}
|
||||
|
||||
// SendBatch sends all queued queries to the server at once. All queries are run in an implicit transaction unless
|
||||
// explicit transaction control statements are executed.
|
||||
// explicit transaction control statements are executed. The returned BatchResults must be closed before the connection
|
||||
// is used again.
|
||||
func (c *Conn) SendBatch(ctx context.Context, b *Batch) BatchResults {
|
||||
distinctUnpreparedQueries := map[string]struct{}{}
|
||||
|
||||
|
|
Loading…
Reference in New Issue