16 lines
565 B
Go
16 lines
565 B
Go
|
|
package mysql
|
||
|
|
|
||
|
|
// Tx extends [Executor] with commit and rollback. Obtained via [Provider.Begin]
|
||
|
|
// or [Provider.BeginTx] when manual transaction control is needed.
|
||
|
|
// Prefer [UnitOfWork] for the common case of a single transactional unit.
|
||
|
|
//
|
||
|
|
// Note: database/sql does not support per-call context on Commit or Rollback.
|
||
|
|
// These methods honestly omit ctx rather than accepting and ignoring it.
|
||
|
|
type Tx interface {
|
||
|
|
Executor
|
||
|
|
// Commit commits the transaction.
|
||
|
|
Commit() error
|
||
|
|
// Rollback rolls back the transaction. Safe to call after Commit.
|
||
|
|
Rollback() error
|
||
|
|
}
|