exec

package
v0.1.10-0...-9bf53c4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDataResourceManager

func InitDataResourceManager()

Types

type DB

type DB struct {
	*sql.DB

	ResourceGroupId string
	// contains filtered or unexported fields
}

func NewDB

func NewDB(conf config.ATConfig, db *sql.DB) (*DB, error)

func (*DB) Begin

func (db *DB) Begin(ctx *context.RootContext) (*Tx, error)

func (*DB) GetBranchType

func (db *DB) GetBranchType() meta.BranchType

func (*DB) GetResourceGroupId

func (db *DB) GetResourceGroupId() string

func (*DB) GetResourceId

func (db *DB) GetResourceId() string

type DataSourceManager

type DataSourceManager struct {
	rm.AbstractResourceManager
}

func (DataSourceManager) BranchCommit

func (resourceManager DataSourceManager) BranchCommit(branchType meta.BranchType, xid string, branchId int64,
	resourceId string, applicationData []byte) (meta.BranchStatus, error)

func (DataSourceManager) BranchRollback

func (resourceManager DataSourceManager) BranchRollback(branchType meta.BranchType, xid string, branchId int64,
	resourceId string, applicationData []byte) (meta.BranchStatus, error)

func (DataSourceManager) GetBranchType

func (resourceManager DataSourceManager) GetBranchType() meta.BranchType

func (DataSourceManager) LockQuery

func (resourceManager DataSourceManager) LockQuery(branchType meta.BranchType, resourceId string, xid string,
	lockKeys string) (bool, error)

type DeleteExecutor

type DeleteExecutor struct {
	// contains filtered or unexported fields
}

func (*DeleteExecutor) AfterImage

func (executor *DeleteExecutor) AfterImage() (*schema.TableRecords, error)

func (*DeleteExecutor) BeforeImage

func (executor *DeleteExecutor) BeforeImage() (*schema.TableRecords, error)

func (*DeleteExecutor) Execute

func (executor *DeleteExecutor) Execute() (sql.Result, error)

func (*DeleteExecutor) PrepareUndoLog

func (executor *DeleteExecutor) PrepareUndoLog(beforeImage, afterImage *schema.TableRecords)

type InsertExecutor

type InsertExecutor struct {
	// contains filtered or unexported fields
}

func (*InsertExecutor) AfterImage

func (executor *InsertExecutor) AfterImage(result sql.Result) (*schema.TableRecords, error)

func (*InsertExecutor) BeforeImage

func (executor *InsertExecutor) BeforeImage() (*schema.TableRecords, error)

func (*InsertExecutor) BuildTableRecords

func (executor *InsertExecutor) BuildTableRecords(pkValues []interface{}) (*schema.TableRecords, error)

func (*InsertExecutor) Execute

func (executor *InsertExecutor) Execute() (sql.Result, error)

func (*InsertExecutor) GetColumnLen

func (executor *InsertExecutor) GetColumnLen() int

func (*InsertExecutor) GetPkIndex

func (executor *InsertExecutor) GetPkIndex() int

func (*InsertExecutor) GetPkValuesByColumn

func (executor *InsertExecutor) GetPkValuesByColumn() []interface{}

func (*InsertExecutor) PrepareUndoLog

func (executor *InsertExecutor) PrepareUndoLog(beforeImage, afterImage *schema.TableRecords)

type SelectForUpdateExecutor

type SelectForUpdateExecutor struct {
	// contains filtered or unexported fields
}

func (*SelectForUpdateExecutor) Execute

func (executor *SelectForUpdateExecutor) Execute(lockRetryInterval time.Duration, lockRetryTimes int) (*sql.Rows, error)

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func (*Tx) Commit

func (tx *Tx) Commit() error

func (*Tx) Exec

func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error)

func (*Tx) Query

func (tx *Tx) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*Tx) Rollback

func (tx *Tx) Rollback() error

type UpdateExecutor

type UpdateExecutor struct {
	// contains filtered or unexported fields
}

func (*UpdateExecutor) AfterImage

func (executor *UpdateExecutor) AfterImage(beforeImage *schema.TableRecords) (*schema.TableRecords, error)

func (*UpdateExecutor) BeforeImage

func (executor *UpdateExecutor) BeforeImage() (*schema.TableRecords, error)

func (*UpdateExecutor) Execute

func (executor *UpdateExecutor) Execute() (sql.Result, error)

func (*UpdateExecutor) PrepareUndoLog

func (executor *UpdateExecutor) PrepareUndoLog(beforeImage, afterImage *schema.TableRecords)

Jump to

Keyboard shortcuts

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