parser

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchDDLTableNames

func FetchDDLTableNames(schema string, stmt ast.StmtNode) ([]*filter.Table, error)

FetchDDLTableNames returns table names in ddl the result contains [tableName] excepted create table like and rename table for `create table like` DDL, result contains [sourceTableName, sourceRefTableName] for rename table ddl, result contains [oldTableName, newTableName]

func Parse

func Parse(p *parser.Parser, sql, charset, collation string) (stmt []ast.StmtNode, err error)

Parse wraps parser.Parse(), makes `parser` suitable for dm

func RenameDDLTable

func RenameDDLTable(stmt ast.StmtNode, targetTableNames []*filter.Table) (string, error)

RenameDDLTable renames table names in ddl by given `targetTableNames` argument `targetTableNames` is same with return value of FetchDDLTableNames

func SplitDDL

func SplitDDL(stmt ast.StmtNode, schema string) (sqls []string, err error)

SplitDDL splits multiple operations in one DDL statement into multiple DDL statements if fail to restore, it would not restore the value of `stmt` (it changes it's values if `stmt` is one of DropTableStmt, RenameTableStmt, AlterTableStmt)

Types

This section is empty.

Jump to

Keyboard shortcuts

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