Versions in this module Expand all Collapse all v0 v0.8.1 Oct 23, 2018 v0.8.0 Oct 19, 2018 Changes in this version + const TokenTypeBacktickQuote + const TokenTypeBlockComment + const TokenTypeBoundary + const TokenTypeComment + const TokenTypeError + const TokenTypeNumber + const TokenTypeQuote + const TokenTypeReserved + const TokenTypeReservedNewline + const TokenTypeReservedToplevel + const TokenTypeVariable + const TokenTypeWhitespace + const TokenTypeWord + var RewriteRules = []Rule + var TokenString = map[int]string + func AlterAffectTable(stmt sqlparser.Statement) string + func Compress(sql string) string + func FindAllCols(node sqlparser.SQLNode, targets ...string) []*common.Column + func FindAllCondition(node sqlparser.SQLNode) []interface + func FindColumn(node sqlparser.SQLNode) []*common.Column + func FindEQColsInJoinCond(node sqlparser.SQLNode) []*common.Column + func FindEQColsInWhere(node sqlparser.SQLNode) []*common.Column + func FindGroupByCols(node sqlparser.SQLNode) []*common.Column + func FindINEQColsInJoinCond(node sqlparser.SQLNode) []*common.Column + func FindINEQColsInWhere(node sqlparser.SQLNode) []*common.Column + func FindJoinCols(node sqlparser.SQLNode) [][]*common.Column + func FindJoinTable(node sqlparser.SQLNode, meta common.Meta) common.Meta + func FindOrderByCols(node sqlparser.SQLNode) []*common.Column + func FindSubquery(depth int, node sqlparser.SQLNode, queries ...string) []string + func FindWhereEQ(node sqlparser.SQLNode) []*common.Column + func FindWhereINEQ(node sqlparser.SQLNode) []*common.Column + func GetMeta(stmt sqlparser.Statement, meta common.Meta) common.Meta + func GetSubqueryDepth(node sqlparser.SQLNode) int + func GetTableFromExprs(exprs sqlparser.TableExprs, metas ...common.Meta) common.Meta + func IsMysqlKeyword(name string) bool + func LeftNewLines(buf []byte) int + func ListRewriteRules(rules []Rule) + func MergeAlterTables(sqls ...string) map[string]string + func MysqlEscapeString(source string) (string, error) + func NewLines(buf []byte) int + func Pretty(sql string, method string) (output string) + func PrintPrettyStmtNode(sql, charset, collation string) + func RewriteRuleMatch(name string) bool + func SplitStatement(buf []byte, delimiter []byte) (string, []byte) + func TiParse(sql, charset, collation string) ([]ast.StmtNode, error) + type NodeItem struct + Array *NodeList + ID int + Next *NodeItem + Prev *NodeItem + Self sqlparser.SQLNode + type NodeList struct + Head *NodeItem + Length int + NodeMap map[int]*NodeItem + func NewNodeList(statement sqlparser.Statement) *NodeList + func (l *NodeList) Add(node sqlparser.SQLNode) *NodeItem + func (l *NodeList) First() *NodeItem + func (l *NodeList) Last() *NodeItem + func (l *NodeList) Remove(node *NodeItem) error + type Rewrite struct + Columns common.TableColumns + NewSQL string + SQL string + Stmt sqlparser.Statement + func NewRewrite(sql string) *Rewrite + func (rw *Rewrite) Rewrite() *Rewrite + func (rw *Rewrite) RewriteAddOrderByNull() *Rewrite + func (rw *Rewrite) RewriteAlwaysTrue() (reWriter *Rewrite) + func (rw *Rewrite) RewriteAutoIncrement() *Rewrite + func (rw *Rewrite) RewriteCountStar() *Rewrite + func (rw *Rewrite) RewriteDML2Select() *Rewrite + func (rw *Rewrite) RewriteDelimiter() *Rewrite + func (rw *Rewrite) RewriteDistinctStar() *Rewrite + func (rw *Rewrite) RewriteGroupByConst() *Rewrite + func (rw *Rewrite) RewriteHaving() *Rewrite + func (rw *Rewrite) RewriteInNull() *Rewrite + func (rw *Rewrite) RewriteInnoDB() *Rewrite + func (rw *Rewrite) RewriteInsertColumns() *Rewrite + func (rw *Rewrite) RewriteIntWidth() *Rewrite + func (rw *Rewrite) RewriteJoin2SubQuery() *Rewrite + func (rw *Rewrite) RewriteOr2In() *Rewrite + func (rw *Rewrite) RewriteOr2Union() *Rewrite + func (rw *Rewrite) RewriteRemoveDMLOrderBy() *Rewrite + func (rw *Rewrite) RewriteRmParenthesis() *Rewrite + func (rw *Rewrite) RewriteStandard() *Rewrite + func (rw *Rewrite) RewriteStar2Columns() *Rewrite + func (rw *Rewrite) RewriteSubQuery2Join() *Rewrite + func (rw *Rewrite) RewriteTruncate() *Rewrite + func (rw *Rewrite) RewriteUnionAll() *Rewrite + type Rule struct + Description string + Func func(*Rewrite) *Rewrite + Name string + Original string + Suggest string + type TiVisitor struct + EnterFunc func(node ast.Node) bool + LeaveFunc func(node ast.Node) bool + func (visitor *TiVisitor) Enter(n ast.Node) (node ast.Node, skip bool) + func (visitor *TiVisitor) Leave(n ast.Node) (node ast.Node, ok bool) + type Token struct + Type int + Val string + func Tokenize(sql string) []Token + func Tokenizer(sql string) []Token