Add docs regarding closing BatchResults
This commit is contained in:
@@ -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 reads the results from the next query in the batch as if the query has been sent with Conn.QueryRow.
|
||||||
QueryRow() Row
|
QueryRow() Row
|
||||||
|
|
||||||
// Close closes the batch operation. Any error that occurred during a batch operation may have made it impossible to
|
// Close closes the batch operation. This must be called before the underlying connection can be used again. Any error
|
||||||
// resyncronize the connection with the server. In this case the underlying connection will have been closed.
|
// 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
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
// 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 {
|
func (c *Conn) SendBatch(ctx context.Context, b *Batch) BatchResults {
|
||||||
distinctUnpreparedQueries := map[string]struct{}{}
|
distinctUnpreparedQueries := map[string]struct{}{}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user