Versions in this module Expand all Collapse all v0 v0.1.14 Mar 27, 2017 v0.1.13 Jan 28, 2017 v0.1.12 Jan 28, 2017 Changes in this version + var ErrMsgBadColumn = "invalid method" + var ErrMsgBadDuring = "invalid during" + var ErrMsgBadField = "invalid field" + var ErrMsgBadFunc = "invalid function" + var ErrMsgBadGroup = "invalid group by" + var ErrMsgBadLimit = "invalid limit" + var ErrMsgBadMethod = "invalid method" + var ErrMsgBadOrder = "invalid order by" + var ErrMsgBadSrc = "invalid source" + var ErrMsgBadStmt = "unkwown statement" + var ErrMsgColumnsNotMatch = "invalid method" + var ErrMsgDuringDateSize = "expected no literal date" + var ErrMsgDuringLitSize = "expected date range literal" + var ErrMsgDuringSize = "unexpected number of date range" + var ErrMsgMissingSrc = "missing source" + var ErrMsgSyntax = "syntax near" + func NewParserError(text string) error + func NewXParserError(text string, arg interface{}) error + type Column struct + ColumnAlias string + ColumnName string + func NewColumn(name, alias string) *Column + func (c *Column) Alias() string + func (c *Column) Name() string + type ColumnPosition struct + ColumnPos int + func NewColumnPosition(col *Column, pos int) *ColumnPosition + func (c *ColumnPosition) Position() int + type Condition interface + Operator func() string + Value func() (value []string, literal bool) + type CreateViewStatement struct + Replace bool + View *SelectStatement + func (s CreateViewStatement) ReplaceMode() bool + func (s CreateViewStatement) SourceQuery() SelectStmt + func (s CreateViewStatement) String() (q string) + type CreateViewStmt interface + ReplaceMode func() bool + SourceQuery func() SelectStmt + type DataStatement struct + Fields []DynamicField + TableName string + func (s DataStatement) Columns() []DynamicField + func (s DataStatement) SourceName() string + type DataStmt interface + Columns func() []DynamicField + SourceName func() string + type DescribeStatement struct + func (s DescribeStatement) String() (q string) + type DescribeStmt interface + type DynamicColumn struct + Method string + Unique bool + func NewDynamicColumn(col *Column, method string, unique bool) *DynamicColumn + func (c *DynamicColumn) Distinct() bool + func (c *DynamicColumn) UseFunction() (string, bool) + type DynamicField interface + Distinct func() bool + UseFunction func() (string, bool) + type Field interface + Alias func() string + Name func() string + type FieldPosition interface + Position func() int + type FullStatement struct + Full bool + func (s FullStatement) FullMode() bool + type FullStmt interface + FullMode func() bool + type Limit struct + Offset int + RowCount int + WithRowCount bool + type Order struct + SortDesc bool + func (o *Order) SortDescending() bool + type Orderer interface + SortDescending func() bool + type Parser struct + func NewParser(r io.Reader) *Parser + func (p *Parser) Parse() (statements []Stmt, err error) + func (p *Parser) ParseCreateView() (CreateViewStmt, error) + func (p *Parser) ParseDescribe() (DescribeStmt, error) + func (p *Parser) ParseRow() (Stmt, error) + func (p *Parser) ParseSelect() (SelectStmt, error) + func (p *Parser) ParseShow() (ShowStmt, error) + type ParserError struct + func (e *ParserError) Error() string + type Pattern struct + Contains string + Equal string + Prefix string + Suffix string + type Scanner struct + func NewScanner(r io.Reader) *Scanner + func (s *Scanner) Scan() (Token, string) + type SelectStatement struct + During []string + GroupBy []FieldPosition + OrderBy []Orderer + Where []Condition + func (s SelectStatement) ConditionList() []Condition + func (s SelectStatement) DuringList() []string + func (s SelectStatement) GroupList() []FieldPosition + func (s SelectStatement) LegacyString() (q string) + func (s SelectStatement) OrderList() []Orderer + func (s SelectStatement) PageSize() (int, bool) + func (s SelectStatement) StartIndex() int + func (s SelectStatement) String() (q string) + type SelectStmt interface + ConditionList func() []Condition + DuringList func() []string + GroupList func() []FieldPosition + LegacyString func() string + OrderList func() []Orderer + PageSize func() (int, bool) + StartIndex func() int + type ShowStatement struct + Like Pattern + UseWith bool + With string + func (s ShowStatement) LikePattern() (Pattern, bool) + func (s ShowStatement) String() (q string) + func (s ShowStatement) WithFieldName() (string, bool) + type ShowStmt interface + LikePattern func() (p Pattern, used bool) + WithFieldName func() (name string, used bool) + type Statement struct + GModifier bool + func (s Statement) VerticalOutput() bool + type Stmt interface + VerticalOutput func() bool + type Token int + const AND + const AS + const ASC + const ASTERISK + const BY + const COMMA + const CONTAINS + const CONTAINS_IGNORE_CASE + const CREATE + const DECIMAL + const DESC + const DESCRIBE + const DIFFERENT + const DIGIT + const DISTINCT + const DOES_NOT_CONTAIN + const DOES_NOT_CONTAIN_IGNORE_CASE + const DURING + const EOF + const EQUAL + const FROM + const FULL + const GROUP + const G_MODIFIER + const IDENTIFIER + const ILLEGAL + const IN + const INFERIOR + const INFERIOR_OR_EQUAL + const LEFT_PARENTHESIS + const LEFT_SQUARE_BRACKETS + const LIKE + const LIMIT + const NOT_IN + const OR + const ORDER + const REPLACE + const RIGHT_PARENTHESIS + const RIGHT_SQUARE_BRACKETS + const SELECT + const SEMICOLON + const SHOW + const STARTS_WITH + const STARTS_WITH_IGNORE_CASE + const STRING + const STRING_LIST + const SUPERIOR + const SUPERIOR_OR_EQUAL + const TABLES + const VALUE_LITERAL + const VALUE_LITERAL_LIST + const VIEW + const WHERE + const WHITE_SPACE + const WITH + type Where struct + ColumnValue []string + IsValueLiteral bool + Sign string + func (c *Where) Operator() string + func (c *Where) Value() ([]string, bool)