Versions in this module Expand all Collapse all v1 v1.0.0 May 24, 2019 Changes in this version + const StmtBegin + const StmtComment + const StmtCommit + const StmtDDL + const StmtDelete + const StmtInsert + const StmtOther + const StmtReplace + const StmtRollback + const StmtSelect + const StmtSet + const StmtShow + const StmtStream + const StmtUnknown + const StmtUpdate + const StmtUse + var ErrParse = terror.ClassParser.New(codeErrParse, mysql.MySQLErrName[mysql.ErrParse]) + var ErrSyntax = terror.ClassParser.New(codeErrSyntax, mysql.MySQLErrName[mysql.ErrSyntax]) + var SpecFieldPattern = regexp.MustCompile(`(\/\*!(M?[0-9]{5,6})?|\*\/)`) + func NodeToStringWithoutQuote(node ast.Node) (string, error) + func ParseErrorWith(errstr string, lineno int) error + func ParseSQL(sql string) (ast.StmtNode, error) + func Preview(sql string) int + func StmtType(stmtType int) string + func StripLeadingComments(sql string) string + func TrimComment(txt string) string + type CommentDirectives map[string]interface + func (d CommentDirectives) IsSet(key string) bool + type MarginComments struct + Leading string + Trailing string + func SplitMarginComments(sql string) (query string, comments MarginComments) + type Parser struct + func New() *Parser + func (parser *Parser) EnableWindowFunc(val bool) + func (parser *Parser) Parse(sql, charset, collation string) (stmt []ast.StmtNode, warns []error, err error) + func (parser *Parser) ParseOneStmt(sql, charset, collation string) (ast.StmtNode, error) + func (parser *Parser) SetSQLMode(mode mysql.SQLMode) + type Pos struct + Col int + Line int + Offset int + type Scanner struct + func NewScanner(s string) *Scanner + func (s *Scanner) EnableWindowFunc(val bool) + func (s *Scanner) Errorf(format string, a ...interface{}) + func (s *Scanner) Errors() (warns []error, errs []error) + func (s *Scanner) GetSQLMode() mysql.SQLMode + func (s *Scanner) Lex(v *yySymType) int + func (s *Scanner) SetSQLMode(mode mysql.SQLMode)