transaction

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

Transaction represents a database transaction. Contains GORM transaction to ensure all DAO operations participate in the transaction.

func BuildWithGORM added in v0.2.1

func BuildWithGORM(db *gorm.DB) *Transaction

BuildWithGORM creates a new transaction object with GORM transaction.

func (*Transaction) Commit

func (tx *Transaction) Commit() error

func (*Transaction) MarkedForRollback

func (tx *Transaction) MarkedForRollback() bool

MarkedForRollback returns true if a transaction is flagged for rollback and false otherwise.

func (*Transaction) Rollback

func (tx *Transaction) Rollback() error

Rollback ends the transaction by rolling back

func (*Transaction) SetRollbackFlag

func (tx *Transaction) SetRollbackFlag(flag bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL