Add doc for (*Tx) BeginBatch()

pull/336/head
Jack Christensen 2017-09-25 11:01:23 -05:00
parent 3ed4e7488e
commit 5789af0b64
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,7 @@ type Batch struct {
pendingCommandComplete bool
ctx context.Context
err error
inTx bool
inTx bool
}
// BeginBatch returns a *Batch query for c.
@ -32,6 +32,8 @@ func (c *Conn) BeginBatch() *Batch {
return &Batch{conn: c}
}
// BeginBatch returns a *Batch query for tx. Since this *Batch is already part
// of a transaction it will not automatically be wrapped in a transaction.
func (tx *Tx) BeginBatch() *Batch {
return &Batch{conn: tx.conn, inTx: true}
}