Versions in this module Expand all Collapse all v1 v1.0.1 Jul 6, 2023 v1.0.0 Dec 2, 2022 Changes in this version + const ADMIN + const ALL + const ALTER + const AND + const AS + const ASC + const AST_ALTER + const AST_ASC + const AST_BETWEEN + const AST_BITAND + const AST_BITOR + const AST_BITXOR + const AST_CREATE + const AST_CROSS_JOIN + const AST_DESC + const AST_DISTINCT + const AST_DIV + const AST_DROP + const AST_EQ + const AST_EXCEPT + const AST_FORCE + const AST_FOR_UPDATE + const AST_GE + const AST_GT + const AST_HAVING + const AST_IGNORE + const AST_IN + const AST_INTERSECT + const AST_IS_NOT_NULL + const AST_IS_NULL + const AST_JOIN + const AST_LE + const AST_LEFT_JOIN + const AST_LIKE + const AST_LT + const AST_MINUS + const AST_MOD + const AST_MULT + const AST_NATURAL_JOIN + const AST_NE + const AST_NOT_BETWEEN + const AST_NOT_IN + const AST_NOT_LIKE + const AST_NSE + const AST_PLUS + const AST_RENAME + const AST_RIGHT_JOIN + const AST_SET_MINUS + const AST_SHARE_MODE + const AST_STRAIGHT_JOIN + const AST_TABLE + const AST_TILDA + const AST_UMINUS + const AST_UNION + const AST_UNION_ALL + const AST_UPLUS + const AST_USE + const AST_WHERE + const BEGIN + const BETWEEN + const BY + const CASE + const COLLATE + const COMMENT + const COMMIT + const CREATE + const CROSS + const DEFAULT + const DELETE + const DESC + const DISTINCT + const DROP + const DUPLICATE + const ELSE + const END + const EOFCHAR + const EXCEPT + const EXISTS + const FOR + const FORCE + const FROM + const GE + const GROUP + const HAVING + const HELP + const ID + const IF + const IGNORE + const IN + const INDEX + const INNER + const INSERT + const INTERSECT + const INTO + const IS + const JOIN + const KEY + const LE + const LEFT + const LEX_ERROR + const LIKE + const LIMIT + const LOCK + const MINUS + const NAMES + const NATURAL + const NE + const NOT + const NULL + const NULL_SAFE_EQUAL + const NUMBER + const OFFSET + const ON + const OR + const ORDER + const OUTER + const RENAME + const REPLACE + const RIGHT + const ROLLBACK + const SELECT + const SET + const START + const STRAIGHT_JOIN + const STRING + const TABLE + const THEN + const TO + const TRANSACTION + const TRUNCATE + const UNARY + const UNION + const UNIQUE + const UPDATE + const USE + const USING + const VALUES + const VALUE_ARG + const VIEW + const WHEN + const WHERE + var IF_BYTES = []byte("if") + var MODE = []byte("mode") + var SHARE = []byte("share") + var VALUES_BYTES = []byte("values") + func AsInterface(node ValExpr) (interface{}, error) + func ForceEOF(yylex interface{}) + func GetColName(node Expr) string + func GetDBName(sql string) (string, error) + func GetDBTable(token string) (string, string) + func GetInsertDBTable(token string) (string, string) + func HasINClause(conditions []BoolExpr) bool + func IsColName(node ValExpr) bool + func IsSimpleTuple(node ValExpr) bool + func IsValue(node ValExpr) bool + func SetAllowComments(yylex interface{}, allow bool) + func SetParseTree(yylex interface{}, stmt Statement) + func String(node SQLNode) string + func StringIn(str string, values ...string) bool + type Admin struct + Columns Columns + Region *TableName + Rows InsertRows + func (*Admin) IStatement() + func (node *Admin) Format(buf *TrackedBuffer) + type AdminHelp struct + func (*AdminHelp) IStatement() + func (node *AdminHelp) Format(buf *TrackedBuffer) + type AliasedTableExpr struct + As []byte + Expr SimpleTableExpr + Hints *IndexHints + func (*AliasedTableExpr) ITableExpr() + func (node *AliasedTableExpr) Format(buf *TrackedBuffer) + type AndExpr struct + Left BoolExpr + Right BoolExpr + func (*AndExpr) IBoolExpr() + func (*AndExpr) IExpr() + func (node *AndExpr) Format(buf *TrackedBuffer) + type Begin struct + func (*Begin) IStatement() + func (node *Begin) Format(buf *TrackedBuffer) + type BinaryExpr struct + Left Expr + Operator byte + Right Expr + func (*BinaryExpr) IExpr() + func (*BinaryExpr) IValExpr() + func (node *BinaryExpr) Format(buf *TrackedBuffer) + type BoolExpr interface + IBoolExpr func() + type CaseExpr struct + Else ValExpr + Expr ValExpr + Whens []*When + func (*CaseExpr) IExpr() + func (*CaseExpr) IValExpr() + func (node *CaseExpr) Format(buf *TrackedBuffer) + type ColName struct + Name []byte + Qualifier []byte + func (*ColName) IExpr() + func (*ColName) IValExpr() + func (node *ColName) Format(buf *TrackedBuffer) + type Columns []SelectExpr + func (node Columns) Format(buf *TrackedBuffer) + type Comments [][]byte + func (node Comments) Format(buf *TrackedBuffer) + type Commit struct + func (*Commit) IStatement() + func (node *Commit) Format(buf *TrackedBuffer) + type ComparisonExpr struct + Left ValExpr + Operator string + Right ValExpr + func (*ComparisonExpr) IBoolExpr() + func (*ComparisonExpr) IExpr() + func (node *ComparisonExpr) Format(buf *TrackedBuffer) + type DDL struct + Action string + Ignore string + NewName []byte + Table []byte + func (*DDL) IStatement() + func (node *DDL) Format(buf *TrackedBuffer) + type Delete struct + Comments Comments + Limit *Limit + OrderBy OrderBy + Table *TableName + Where *Where + func (*Delete) IStatement() + func (node *Delete) Format(buf *TrackedBuffer) + type ExistsExpr struct + Subquery *Subquery + func (*ExistsExpr) IBoolExpr() + func (*ExistsExpr) IExpr() + func (node *ExistsExpr) Format(buf *TrackedBuffer) + type Expr interface + IExpr func() + type FuncExpr struct + Distinct bool + Exprs SelectExprs + Name []byte + func (*FuncExpr) IExpr() + func (*FuncExpr) IValExpr() + func (node *FuncExpr) Format(buf *TrackedBuffer) + type GroupBy []ValExpr + func (node GroupBy) Format(buf *TrackedBuffer) + type IndexHints struct + Indexes [][]byte + Type string + func (node *IndexHints) Format(buf *TrackedBuffer) + type Insert struct + Columns Columns + Comments Comments + Ignore string + OnDup OnDup + Rows InsertRows + Table *TableName + func (*Insert) IStatement() + func (node *Insert) Format(buf *TrackedBuffer) + type InsertRows interface + IInsertRows func() + type JoinTableExpr struct + Join string + LeftExpr TableExpr + On BoolExpr + RightExpr TableExpr + func (*JoinTableExpr) ITableExpr() + func (node *JoinTableExpr) Format(buf *TrackedBuffer) + type Limit struct + Offset ValExpr + Rowcount ValExpr + func (node *Limit) Format(buf *TrackedBuffer) + func (node *Limit) RewriteLimit() (*Limit, error) + type NonStarExpr struct + As []byte + Expr Expr + func (*NonStarExpr) ISelectExpr() + func (node *NonStarExpr) Format(buf *TrackedBuffer) + type NotExpr struct + Expr BoolExpr + func (*NotExpr) IBoolExpr() + func (*NotExpr) IExpr() + func (node *NotExpr) Format(buf *TrackedBuffer) + type NullCheck struct + Expr ValExpr + Operator string + func (*NullCheck) IBoolExpr() + func (*NullCheck) IExpr() + func (node *NullCheck) Format(buf *TrackedBuffer) + type NullVal struct + func (*NullVal) IExpr() + func (*NullVal) IValExpr() + func (node *NullVal) Format(buf *TrackedBuffer) + type NumVal []byte + func (NumVal) IExpr() + func (NumVal) IValExpr() + func (node NumVal) Format(buf *TrackedBuffer) + type OnDup UpdateExprs + func (node OnDup) Format(buf *TrackedBuffer) + type OrExpr struct + Left BoolExpr + Right BoolExpr + func (*OrExpr) IBoolExpr() + func (*OrExpr) IExpr() + func (node *OrExpr) Format(buf *TrackedBuffer) + type Order struct + Direction string + Expr ValExpr + func (node *Order) Format(buf *TrackedBuffer) + type OrderBy []*Order + func (node OrderBy) Format(buf *TrackedBuffer) + type ParenBoolExpr struct + Expr BoolExpr + func (*ParenBoolExpr) IBoolExpr() + func (*ParenBoolExpr) IExpr() + func (node *ParenBoolExpr) Format(buf *TrackedBuffer) + type ParenTableExpr struct + Expr TableExpr + func (*ParenTableExpr) ITableExpr() + func (node *ParenTableExpr) Format(buf *TrackedBuffer) + type ParserError struct + Message string + func NewParserError(format string, args ...interface{}) ParserError + func (err ParserError) Error() string + type RangeCond struct + From ValExpr + Left ValExpr + Operator string + To ValExpr + func (*RangeCond) IBoolExpr() + func (*RangeCond) IExpr() + func (node *RangeCond) Format(buf *TrackedBuffer) + type Replace struct + Columns Columns + Comments Comments + Rows InsertRows + Table *TableName + func (*Replace) IStatement() + func (node *Replace) Format(buf *TrackedBuffer) + type Rollback struct + func (*Rollback) IStatement() + func (node *Rollback) Format(buf *TrackedBuffer) + type SQLNode interface + Format func(buf *TrackedBuffer) + type Select struct + Comments Comments + Distinct string + From TableExprs + GroupBy GroupBy + Having *Where + Limit *Limit + Lock string + OrderBy OrderBy + SelectExprs SelectExprs + Where *Where + func (*Select) IInsertRows() + func (*Select) ISelectStatement() + func (*Select) IStatement() + func (node *Select) Format(buf *TrackedBuffer) + type SelectExpr interface + ISelectExpr func() + type SelectExprs []SelectExpr + func (node SelectExprs) Format(buf *TrackedBuffer) + type SelectStatement interface + IInsertRows func() + ISelectStatement func() + IStatement func() + type Set struct + Comments Comments + Exprs UpdateExprs + func (*Set) IStatement() + func (node *Set) Format(buf *TrackedBuffer) + type Show struct + From ValExpr + Key string + LikeOrWhere Expr + Section string + func (*Show) IStatement() + func (node *Show) Format(buf *TrackedBuffer) + type SimpleSelect struct + Comments Comments + Distinct string + SelectExprs SelectExprs + func (*SimpleSelect) IInsertRows() + func (*SimpleSelect) ISelectStatement() + func (*SimpleSelect) IStatement() + func (node *SimpleSelect) Format(buf *TrackedBuffer) + type SimpleTableExpr interface + ISimpleTableExpr func() + type StarExpr struct + TableName []byte + func (*StarExpr) ISelectExpr() + func (node *StarExpr) Format(buf *TrackedBuffer) + type Statement interface + IStatement func() + func Parse(sql string) (Statement, error) + type StrVal []byte + func (StrVal) IExpr() + func (StrVal) IValExpr() + func (node StrVal) Format(buf *TrackedBuffer) + type Subquery struct + Select SelectStatement + func (*Subquery) IExpr() + func (*Subquery) ISimpleTableExpr() + func (*Subquery) ITuple() + func (*Subquery) IValExpr() + func (node *Subquery) Format(buf *TrackedBuffer) + type TableExpr interface + ITableExpr func() + type TableExprs []TableExpr + func (node TableExprs) Format(buf *TrackedBuffer) + type TableName struct + Name []byte + Qualifier []byte + func (*TableName) ISimpleTableExpr() + func (node *TableName) Format(buf *TrackedBuffer) + type Tokenizer struct + AllowComments bool + ForceEOF bool + InStream *strings.Reader + LastError string + ParseTree Statement + Position int + func NewStringTokenizer(sql string) *Tokenizer + func (tkn *Tokenizer) ConsumeNext(buffer *bytes.Buffer) + func (tkn *Tokenizer) Error(err string) + func (tkn *Tokenizer) Lex(lval *yySymType) int + func (tkn *Tokenizer) Scan() (int, []byte) + type TrackedBuffer struct + func NewTrackedBuffer(nodeFormatter func(buf *TrackedBuffer, node SQLNode)) *TrackedBuffer + func (buf *TrackedBuffer) Fprintf(format string, values ...interface{}) + func (buf *TrackedBuffer) WriteArg(arg string) + type Truncate struct + Comments Comments + Table *TableName + TableOpt string + func (*Truncate) IStatement() + func (node *Truncate) Format(buf *TrackedBuffer) + type Tuple interface + ITuple func() + type UnaryExpr struct + Expr Expr + Operator byte + func (*UnaryExpr) IExpr() + func (*UnaryExpr) IValExpr() + func (node *UnaryExpr) Format(buf *TrackedBuffer) + type Union struct + Left SelectStatement + Right SelectStatement + Type string + func (*Union) IInsertRows() + func (*Union) ISelectStatement() + func (*Union) IStatement() + func (node *Union) Format(buf *TrackedBuffer) + type Update struct + Comments Comments + Exprs UpdateExprs + Limit *Limit + OrderBy OrderBy + Table *TableName + Where *Where + func (*Update) IStatement() + func (node *Update) Format(buf *TrackedBuffer) + type UpdateExpr struct + Expr ValExpr + Name *ColName + func (node *UpdateExpr) Format(buf *TrackedBuffer) + type UpdateExprs []*UpdateExpr + func (node UpdateExprs) Format(buf *TrackedBuffer) + type UseDB struct + DB string + func (*UseDB) IStatement() + func (node *UseDB) Format(buf *TrackedBuffer) + type ValArg []byte + func (ValArg) IExpr() + func (ValArg) IValExpr() + func (node ValArg) Format(buf *TrackedBuffer) + type ValExpr interface + IValExpr func() + type ValExprs []ValExpr + func (node ValExprs) Format(buf *TrackedBuffer) + type ValTuple ValExprs + func (ValTuple) IExpr() + func (ValTuple) ITuple() + func (ValTuple) IValExpr() + func (node ValTuple) Format(buf *TrackedBuffer) + type Values []Tuple + func (Values) IInsertRows() + func (node Values) Format(buf *TrackedBuffer) + type When struct + Cond BoolExpr + Val ValExpr + func (node *When) Format(buf *TrackedBuffer) + type Where struct + Expr BoolExpr + Type string + func NewWhere(typ string, expr BoolExpr) *Where + func (node *Where) Format(buf *TrackedBuffer)