common

package
v0.0.0-...-daf8b82 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTxnCompleted    = errors.New("transaction is already aborted or committed")
	ErrTxnAborted      = errors.New("transaction is already aborted")
	ErrTxnCommitted    = errors.New("transaction is already committed")
	ErrTxnNotPrepared  = errors.New("transaction is not prepared")
	ErrTxnInvalidState = errors.New("invalid state")
	ErrNotExist        = errors.New("not exist")
)

Functions

func CreateTransaction

func CreateTransaction(tx *sql.Tx, gtid string, branch int, state string) error

func SetDbSchema

func SetDbSchema(schema string)

SetDbSchema set database schema, only useful for postgreSQL

func UpdateTransactionState

func UpdateTransactionState(tx *sql.Tx, gtid string, branch int, state string) error

func UpdateTransactionStateOrm

func UpdateTransactionStateOrm(tx *gorm.DB, gtid string, branch int, state string) error

Types

type RmTransaction

type RmTransaction struct {
	Gtid  string
	Bid   int
	State string
}

RmTransaction

func FindTransaction

func FindTransaction(tx *sql.Tx, gtid string, branch int) (*RmTransaction, error)

func FindTransactionOrm

func FindTransactionOrm(tx *gorm.DB, gtid string, branch int) (*RmTransaction, error)

func (*RmTransaction) TableName

func (*RmTransaction) TableName() string

Jump to

Keyboard shortcuts

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