Documentation ¶
Index ¶
- func NewReadWriteSplittingExecutor(conf *config.Executor) (proto.Executor, error)
- func NewShardingExecutor(conf *config.Executor) (proto.Executor, error)
- func NewSingleDBExecutor(conf *config.Executor) (proto.Executor, error)
- type DBGroupExecutor
- func (ex *DBGroupExecutor) Begin(ctx context.Context) (proto.Tx, proto.Result, error)
- func (ex *DBGroupExecutor) Execute(ctx context.Context, query string) (proto.Result, uint16, error)
- func (ex *DBGroupExecutor) PrepareExecute(ctx context.Context, query string, args ...interface{}) (proto.Result, uint16, error)
- func (ex *DBGroupExecutor) PrepareQuery(ctx context.Context, query string, args ...interface{}) (proto.Result, uint16, error)
- func (ex *DBGroupExecutor) Query(ctx context.Context, query string) (proto.Result, uint16, error)
- type DataSourceBrief
- type ReadWriteSplittingExecutor
- func (executor *ReadWriteSplittingExecutor) ConnectionClose(ctx context.Context)
- func (executor *ReadWriteSplittingExecutor) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)
- func (executor *ReadWriteSplittingExecutor) ExecuteMode() config.ExecuteMode
- func (executor *ReadWriteSplittingExecutor) ExecuteUseDB(ctx context.Context, db string) error
- func (executor *ReadWriteSplittingExecutor) ExecutorComQuery(ctx context.Context, sqlText string) (result proto.Result, warns uint16, err error)
- func (executor *ReadWriteSplittingExecutor) ExecutorComStmtExecute(ctx context.Context, stmt *proto.Stmt) (result proto.Result, warns uint16, err error)
- func (executor *ReadWriteSplittingExecutor) GetPostFilters() []proto.DBPostFilter
- func (executor *ReadWriteSplittingExecutor) GetPreFilters() []proto.DBPreFilter
- func (executor *ReadWriteSplittingExecutor) InGlobalTransaction(ctx context.Context) bool
- func (executor *ReadWriteSplittingExecutor) InLocalTransaction(ctx context.Context) bool
- func (executor *ReadWriteSplittingExecutor) ProcessDistributedTransaction() bool
- type ShardingExecutor
- func (executor *ShardingExecutor) ConnectionClose(ctx context.Context)
- func (executor *ShardingExecutor) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)
- func (executor *ShardingExecutor) ExecuteMode() config.ExecuteMode
- func (executor *ShardingExecutor) ExecuteUseDB(ctx context.Context, db string) error
- func (executor *ShardingExecutor) ExecutorComQuery(ctx context.Context, sql string) (proto.Result, uint16, error)
- func (executor *ShardingExecutor) ExecutorComStmtExecute(ctx context.Context, stmt *proto.Stmt) (result proto.Result, warns uint16, err error)
- func (executor *ShardingExecutor) GetPostFilters() []proto.DBPostFilter
- func (executor *ShardingExecutor) GetPreFilters() []proto.DBPreFilter
- func (executor *ShardingExecutor) InGlobalTransaction(ctx context.Context) bool
- func (executor *ShardingExecutor) InLocalTransaction(ctx context.Context) bool
- func (executor *ShardingExecutor) ProcessDistributedTransaction() bool
- type SingleDBExecutor
- func (executor *SingleDBExecutor) ConnectionClose(ctx context.Context)
- func (executor *SingleDBExecutor) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)
- func (executor *SingleDBExecutor) ExecuteMode() config.ExecuteMode
- func (executor *SingleDBExecutor) ExecuteUseDB(ctx context.Context, schema string) error
- func (executor *SingleDBExecutor) ExecutorComQuery(ctx context.Context, sqlText string) (result proto.Result, warns uint16, err error)
- func (executor *SingleDBExecutor) ExecutorComStmtExecute(ctx context.Context, stmt *proto.Stmt) (result proto.Result, warns uint16, err error)
- func (executor *SingleDBExecutor) GetPostFilters() []proto.DBPostFilter
- func (executor *SingleDBExecutor) GetPreFilters() []proto.DBPreFilter
- func (executor *SingleDBExecutor) InGlobalTransaction(ctx context.Context) bool
- func (executor *SingleDBExecutor) InLocalTransaction(ctx context.Context) bool
- func (executor *SingleDBExecutor) ProcessDistributedTransaction() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBGroupExecutor ¶
type DBGroupExecutor struct {
// contains filtered or unexported fields
}
func (*DBGroupExecutor) PrepareExecute ¶
func (*DBGroupExecutor) PrepareQuery ¶
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
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 (*ReadWriteSplittingExecutor) ExecutorComStmtExecute ¶
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 (*ShardingExecutor) ExecutorComStmtExecute ¶
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 (*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 (*SingleDBExecutor) ExecutorComStmtExecute ¶
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
Click to show internal directories.
Click to hide internal directories.