Files
db-sqlite/tx.go
T

17 lines
583 B
Go
Raw Normal View History

package sqlite
// Tx extends [Executor] with commit and rollback. Obtained via [Provider.Begin]
// when manual transaction control is needed.
// Prefer [UnitOfWork] for the common case of a single transactional unit.
//
// Note: Commit and Rollback accept no context argument — this matches the
// database/sql limitation. The underlying *sql.Tx does not support context
// cancellation on Commit or Rollback.
type Tx interface {
Executor
// Commit commits the transaction.
Commit() error
// Rollback rolls back the transaction. Safe to call after Commit.
Rollback() error
}