executor

package
v0.3.3 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: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReadWriteSplittingExecutor

func NewReadWriteSplittingExecutor(conf *config.Executor) (proto.Executor, error)

func NewShardingExecutor

func NewShardingExecutor(conf *config.Executor) (proto.Executor, error)

func NewSingleDBExecutor

func NewSingleDBExecutor(conf *config.Executor) (proto.Executor, error)

Types

type DBGroupExecutor

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

func (*DBGroupExecutor) Begin

func (ex *DBGroupExecutor) Begin(ctx context.Context) (proto.Tx, proto.Result, error)

func (*DBGroupExecutor) Execute

func (ex *DBGroupExecutor) Execute(ctx context.Context, query string) (proto.Result, uint16, error)

func (*DBGroupExecutor) PrepareExecute

func (ex *DBGroupExecutor) PrepareExecute(ctx context.Context, query string, args ...interface{}) (proto.Result, uint16, error)

func (*DBGroupExecutor) PrepareQuery

func (ex *DBGroupExecutor) PrepareQuery(ctx context.Context, query string, args ...interface{}) (proto.Result, uint16, error)

func (*DBGroupExecutor) Query

func (ex *DBGroupExecutor) Query(ctx context.Context, query string) (proto.Result, uint16, error)

type DataSourceBrief

type DataSourceBrief struct {
	Name        string `yaml:"name" json:"name"`
	WriteWeight int    `yaml:"write_weight" json:"write_weight"`
	ReadWeight  int    `yaml:"read_weight" json:"read_weight"`
	IsMaster    bool   `yaml:"is_master" json:"is_master"`
	DB          proto.DB
}

func (*DataSourceBrief) Counting

func (brief *DataSourceBrief) Counting() bool

func (*DataSourceBrief) Weight

func (brief *DataSourceBrief) Weight(ctx context.Context) int

type ReadWriteSplittingExecutor

type ReadWriteSplittingExecutor struct {
	PreFilters  []proto.DBPreFilter
	PostFilters []proto.DBPostFilter
	// contains filtered or unexported fields
}

func (*ReadWriteSplittingExecutor) ConnectionClose

func (executor *ReadWriteSplittingExecutor) ConnectionClose(ctx context.Context)

func (*ReadWriteSplittingExecutor) ExecuteFieldList

func (executor *ReadWriteSplittingExecutor) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)

ExecuteFieldList https://dev.mysql.com/doc/internals/en/com-field-list.html As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL. Instead, use mysql_query() to execute a SHOW COLUMNS statement.

func (*ReadWriteSplittingExecutor) ExecuteMode

func (executor *ReadWriteSplittingExecutor) ExecuteMode() config.ExecuteMode

func (*ReadWriteSplittingExecutor) ExecuteUseDB

func (executor *ReadWriteSplittingExecutor) ExecuteUseDB(ctx context.Context, db string) error

func (*ReadWriteSplittingExecutor) ExecutorComQuery

func (executor *ReadWriteSplittingExecutor) ExecutorComQuery(
	ctx context.Context, sqlText string) (result proto.Result, warns uint16, err error)

func (*ReadWriteSplittingExecutor) ExecutorComStmtExecute

func (executor *ReadWriteSplittingExecutor) ExecutorComStmtExecute(
	ctx context.Context, stmt *proto.Stmt) (result proto.Result, warns uint16, err error)

func (*ReadWriteSplittingExecutor) GetPostFilters

func (executor *ReadWriteSplittingExecutor) GetPostFilters() []proto.DBPostFilter

func (*ReadWriteSplittingExecutor) GetPreFilters

func (executor *ReadWriteSplittingExecutor) GetPreFilters() []proto.DBPreFilter

func (*ReadWriteSplittingExecutor) InGlobalTransaction

func (executor *ReadWriteSplittingExecutor) InGlobalTransaction(ctx context.Context) bool

func (*ReadWriteSplittingExecutor) InLocalTransaction

func (executor *ReadWriteSplittingExecutor) InLocalTransaction(ctx context.Context) bool

func (*ReadWriteSplittingExecutor) ProcessDistributedTransaction

func (executor *ReadWriteSplittingExecutor) ProcessDistributedTransaction() bool

type ShardingExecutor

type ShardingExecutor struct {
	PreFilters  []proto.DBPreFilter
	PostFilters []proto.DBPostFilter
	// contains filtered or unexported fields
}

func (*ShardingExecutor) ConnectionClose

func (executor *ShardingExecutor) ConnectionClose(ctx context.Context)

func (*ShardingExecutor) ExecuteFieldList

func (executor *ShardingExecutor) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)

ExecuteFieldList https://dev.mysql.com/doc/internals/en/com-field-list.html As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL. Instead, use mysql_query() to execute a SHOW COLUMNS statement.

func (*ShardingExecutor) ExecuteMode

func (executor *ShardingExecutor) ExecuteMode() config.ExecuteMode

func (*ShardingExecutor) ExecuteUseDB

func (executor *ShardingExecutor) ExecuteUseDB(ctx context.Context, db string) error

func (*ShardingExecutor) ExecutorComQuery

func (executor *ShardingExecutor) ExecutorComQuery(ctx context.Context, sql string) (proto.Result, uint16, error)

func (*ShardingExecutor) ExecutorComStmtExecute

func (executor *ShardingExecutor) ExecutorComStmtExecute(
	ctx context.Context, stmt *proto.Stmt) (result proto.Result, warns uint16, err error)

func (*ShardingExecutor) GetPostFilters

func (executor *ShardingExecutor) GetPostFilters() []proto.DBPostFilter

func (*ShardingExecutor) GetPreFilters

func (executor *ShardingExecutor) GetPreFilters() []proto.DBPreFilter

func (*ShardingExecutor) InGlobalTransaction

func (executor *ShardingExecutor) InGlobalTransaction(ctx context.Context) bool

func (*ShardingExecutor) InLocalTransaction

func (executor *ShardingExecutor) InLocalTransaction(ctx context.Context) bool

func (*ShardingExecutor) ProcessDistributedTransaction

func (executor *ShardingExecutor) ProcessDistributedTransaction() bool

type SingleDBExecutor

type SingleDBExecutor struct {
	PreFilters  []proto.DBPreFilter
	PostFilters []proto.DBPostFilter
	// contains filtered or unexported fields
}

func (*SingleDBExecutor) ConnectionClose

func (executor *SingleDBExecutor) ConnectionClose(ctx context.Context)

func (*SingleDBExecutor) ExecuteFieldList

func (executor *SingleDBExecutor) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)

func (*SingleDBExecutor) ExecuteMode

func (executor *SingleDBExecutor) ExecuteMode() config.ExecuteMode

func (*SingleDBExecutor) ExecuteUseDB

func (executor *SingleDBExecutor) ExecuteUseDB(ctx context.Context, schema string) error

func (*SingleDBExecutor) ExecutorComQuery

func (executor *SingleDBExecutor) ExecutorComQuery(
	ctx context.Context, sqlText string) (result proto.Result, warns uint16, err error)

func (*SingleDBExecutor) ExecutorComStmtExecute

func (executor *SingleDBExecutor) ExecutorComStmtExecute(
	ctx context.Context, stmt *proto.Stmt) (result proto.Result, warns uint16, err error)

func (*SingleDBExecutor) GetPostFilters

func (executor *SingleDBExecutor) GetPostFilters() []proto.DBPostFilter

func (*SingleDBExecutor) GetPreFilters

func (executor *SingleDBExecutor) GetPreFilters() []proto.DBPreFilter

func (*SingleDBExecutor) InGlobalTransaction

func (executor *SingleDBExecutor) InGlobalTransaction(ctx context.Context) bool

func (*SingleDBExecutor) InLocalTransaction

func (executor *SingleDBExecutor) InLocalTransaction(ctx context.Context) bool

func (*SingleDBExecutor) ProcessDistributedTransaction

func (executor *SingleDBExecutor) ProcessDistributedTransaction() bool

Jump to

Keyboard shortcuts

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