dbhelper

package
v0.0.0-...-1fa52ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxHelper

type TxHelper[E error] struct {
	// contains filtered or unexported fields
}

TxHelper is a helper for transaction management

func NewTxHelper

func NewTxHelper[E error](basicRes context.BasicRes, errorPointer *E) *TxHelper[E]

NewTxHelper creates a new TxHelper, the errorPointer is used to detect if any error was set

func (*TxHelper[E]) Begin

func (l *TxHelper[E]) Begin() dal.Transaction

Begin starts a transaction

func (*TxHelper[E]) End

func (l *TxHelper[E]) End()

End ends a transaction and commits it if no error was set or it will try to rollback and release locked tables

func (*TxHelper[E]) LockTablesTimeout

func (l *TxHelper[E]) LockTablesTimeout(timeout time.Duration, lockTables dal.LockTables) errors.Error

LockTablesTimeout locks tables with timeout

Jump to

Keyboard shortcuts

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