MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Commit

Method Commit

client/conn.go:316–338  ·  view source on GitHub ↗

Commit implements the driver.Tx.Commit method.

()

Source from the content-addressed store, hash-verified

314
315// Commit implements the driver.Tx.Commit method.
316func (c *conn) Commit() (err error) {
317 if atomic.LoadInt32(&c.closed) != 0 {
318 return driver.ErrBadConn
319 }
320
321 if !c.inTransaction {
322 return sql.ErrTxDone
323 }
324
325 defer func() {
326 c.queries = c.queries[:0]
327 c.inTransaction = false
328 }()
329
330 if len(c.queries) > 0 {
331 // send query
332 if _, _, _, err = c.sendQuery(context.Background(), types.WriteQuery, c.queries); err != nil {
333 return
334 }
335 }
336
337 return
338}
339
340// Rollback implements the driver.Tx.Rollback method.
341func (c *conn) Rollback() error {

Callers

nothing calls this directly

Calls 1

sendQueryMethod · 0.95

Tested by

no test coverage detected