Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TransactionWrapper ¶
func TransactionWrapper(ctx context.Context, dbEngine *xorm.Engine, fn func(session *xorm.Session) error) (err error)
TransactionWrapper is a wrapper for database transaction. It will begin a transaction, execute the given function, and commit or rollback the transaction based on the result of the function. NOTE: nested transaction is not supported, which means that if the given function calls TransactionWrapper again, the inner transaction will not be executed in the existed transaction, but will start a new transaction.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.