Documentation ¶
Index ¶
- func GetTablesNeededExist(stmt ast.StmtNode) ([]string, error)
- func GetTablesNeededNonExist(stmt ast.StmtNode) ([]string, error)
- func IsDDL(stmt ast.StmtNode) bool
- type DDLSyncer
- type ExecutableChecker
- func (ec *ExecutableChecker) Close() error
- func (ec *ExecutableChecker) CreateTable(context context.Context, sql string) error
- func (ec *ExecutableChecker) DropTable(context context.Context, tableName string) error
- func (ec *ExecutableChecker) Execute(context context.Context, sql string) error
- func (ec *ExecutableChecker) IsTableExist(context *context.Context, tableName string) bool
- func (ec *ExecutableChecker) Parse(sql string) (stmt ast.StmtNode, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTablesNeededExist ¶
GetTablesNeededExist reports the table name needed to execute ast.StmtNode the specified ast.StmtNode must be a DDLNode
func GetTablesNeededNonExist ¶
GetTablesNeededNonExist reports the table name that conflicts with ast.StmtNode the specified ast.StmtNode must be a DDLNode
Types ¶
type DDLSyncer ¶
type DDLSyncer struct {
// contains filtered or unexported fields
}
DDLSyncer can sync the table structure from upstream(usually MySQL) to ExecutableChecker
func NewDDLSyncer ¶
func NewDDLSyncer(cfg *dbutil.DBConfig, executableChecker *ExecutableChecker) (*DDLSyncer, error)
NewDDLSyncer create a new DDLSyncer
type ExecutableChecker ¶
type ExecutableChecker struct {
// contains filtered or unexported fields
}
ExecutableChecker is a part of TiDB to check the sql's executability
func NewExecutableChecker ¶
func NewExecutableChecker() (*ExecutableChecker, error)
NewExecutableChecker creates a new ExecutableChecker
func (*ExecutableChecker) Close ¶
func (ec *ExecutableChecker) Close() error
Close closes the ExecutableChecker
func (*ExecutableChecker) CreateTable ¶
func (ec *ExecutableChecker) CreateTable(context context.Context, sql string) error
CreateTable creates a new table with the specified sql
func (*ExecutableChecker) DropTable ¶
func (ec *ExecutableChecker) DropTable(context context.Context, tableName string) error
DropTable drops the the specified table
func (*ExecutableChecker) Execute ¶
func (ec *ExecutableChecker) Execute(context context.Context, sql string) error
Execute executes the sql to check it's executability
func (*ExecutableChecker) IsTableExist ¶
func (ec *ExecutableChecker) IsTableExist(context *context.Context, tableName string) bool
IsTableExist returns whether the table with the specified name exists