Versions in this module Expand all Collapse all v0 v0.0.2 May 3, 2021 v0.0.1 May 3, 2021 Changes in this version + var ErrIntOverflowSql = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthSql = fmt.Errorf("proto: negative length found during unmarshaling") + var SqlKeywords = []string + func EqualWith(l, r u.JsonHelper) bool + func HelperString(w expr.DialectWriter, jh u.JsonHelper) + func MapIntFromPb(kv []KvInt) map[string]int + func NewSqlDialect() expr.DialectWriter + func ParseJsonArray(pg expr.TokenPager) ([]interface{}, error) + func ParseJsonObject(pg expr.TokenPager, jh u.JsonHelper) error + func ParseKeyValue(pg expr.TokenPager, jh u.JsonHelper) error + func ParseWith(pg expr.TokenPager) (u.JsonHelper, error) + func RewriteSelect(m *SqlSelect) + type Column struct + Agg bool + As string + Comment string + Expr expr.Node + Guard expr.Node + Index int + Order string + ParentIndex int + SourceField string + SourceIndex int + SourceOriginal string + Star bool + func NewColumn(col string) *Column + func NewColumnFromToken(tok lex.Token) *Column + func NewColumnValue(tok lex.Token) *Column + func (m *Column) Asc() bool + func (m *Column) Copy() *Column + func (m *Column) CopyRewrite(alias string) *Column + func (m *Column) CountStar() bool + func (m *Column) Equal(c *Column) bool + func (m *Column) InFinalProjection() bool + func (m *Column) IsLiteral() bool + func (m *Column) IsLiteralOrFunc() bool + func (m *Column) Key() string + func (m *Column) LeftRight() (string, string, bool) + func (m *Column) String() string + func (m *Column) ToPB() *ColumnPb + func (m *Column) WriteDialect(w expr.DialectWriter) + type ColumnPb struct + Agg bool + As string + AsQuoteByte []byte + Comment *string + Expr *expr.NodePb + Guard *expr.NodePb + Index int32 + Left *string + Order *string + OriginalAs *string + ParentIndex int32 + Right *string + SourceField *string + SourceIndex int32 + SourceQuote []byte + Star *bool + XXX_unrecognized []byte + func ColumnsToPb(c Columns) []*ColumnPb + func (*ColumnPb) Descriptor() ([]byte, []int) + func (*ColumnPb) ProtoMessage() + func (m *ColumnPb) GetAgg() bool + func (m *ColumnPb) GetAs() string + func (m *ColumnPb) GetAsQuoteByte() []byte + func (m *ColumnPb) GetComment() string + func (m *ColumnPb) GetExpr() *expr.NodePb + func (m *ColumnPb) GetGuard() *expr.NodePb + func (m *ColumnPb) GetIndex() int32 + func (m *ColumnPb) GetLeft() string + func (m *ColumnPb) GetOrder() string + func (m *ColumnPb) GetOriginalAs() string + func (m *ColumnPb) GetParentIndex() int32 + func (m *ColumnPb) GetRight() string + func (m *ColumnPb) GetSourceField() string + func (m *ColumnPb) GetSourceIndex() int32 + func (m *ColumnPb) GetSourceQuote() []byte + func (m *ColumnPb) GetStar() bool + func (m *ColumnPb) Marshal() (data []byte, err error) + func (m *ColumnPb) MarshalTo(data []byte) (int, error) + func (m *ColumnPb) Reset() + func (m *ColumnPb) Size() (n int) + func (m *ColumnPb) String() string + func (m *ColumnPb) Unmarshal(data []byte) error + type Columns []*Column + func ColumnsFromPb(c []*ColumnPb) Columns + func (m *Columns) AliasedFieldNames() []string + func (m *Columns) ByAs(as string) (*Column, bool) + func (m *Columns) ByName(name string) (*Column, bool) + func (m *Columns) FieldNames() []string + func (m *Columns) String() string + func (m *Columns) UnAliasedFieldNames() []string + func (m *Columns) WriteDialect(w expr.DialectWriter) + func (m Columns) Equal(cols Columns) bool + type ColumnsStatement interface + AddColumn func(col Column) error + type CommandColumn struct + Expr expr.Node + Name string + func (m *CommandColumn) FingerPrint(r rune) string + func (m *CommandColumn) Key() string + func (m *CommandColumn) String() string + func (m *CommandColumn) WriteDialect(w expr.DialectWriter) + type CommandColumnPb struct + Expr *expr.NodePb + Name string + XXX_unrecognized []byte + func (*CommandColumnPb) Descriptor() ([]byte, []int) + func (*CommandColumnPb) ProtoMessage() + func (m *CommandColumnPb) GetExpr() *expr.NodePb + func (m *CommandColumnPb) GetName() string + func (m *CommandColumnPb) Marshal() (data []byte, err error) + func (m *CommandColumnPb) MarshalTo(data []byte) (int, error) + func (m *CommandColumnPb) Reset() + func (m *CommandColumnPb) Size() (n int) + func (m *CommandColumnPb) String() string + func (m *CommandColumnPb) Unmarshal(data []byte) error + type CommandColumns []*CommandColumn + func (m *CommandColumns) String() string + func (m *CommandColumns) WriteDialect(w expr.DialectWriter) + type DdlColumn struct + AutoIncrement bool + Comment string + DataType string + DataTypeArgs []expr.Node + DataTypeSize int + Default expr.Node + Expr expr.Node + IndexCols []string + IndexType string + Key lex.TokenType + Kw lex.TokenType + Name string + Null bool + RefCols []string + RefTable string + type Filter interface + String func() string + type FilterQLParser struct + func NewFilterParser(filter string) *FilterQLParser + func NewFilterParserfuncs(filter string, funcs expr.FuncResolver) *FilterQLParser + func (f *FilterQLParser) FuncResolver(funcs expr.FuncResolver) *FilterQLParser + func (f *FilterQLParser) ParseFilter() (*FilterSelect, error) + func (f *FilterQLParser) ParseFilterSelects() (stmts []*FilterSelect, err error) + func (f *FilterQLParser) ParseFilters() (stmts []*FilterStatement, err error) + func (m FilterQLParser) ClauseEnd() bool + func (m FilterQLParser) IsEnd() bool + type FilterSelect struct + Columns Columns + func NewFilterSelect() *FilterSelect + func ParseFilterSelect(query string) (*FilterSelect, error) + func ParseFilterSelects(statement string) (stmts []*FilterSelect, err error) + func (m *FilterSelect) AddColumn(colArg Column) error + func (m *FilterSelect) Equal(s *FilterSelect) bool + func (m *FilterSelect) FingerPrintID() int64 + func (m *FilterSelect) String() string + func (m *FilterSelect) WriteDialect(w expr.DialectWriter) + type FilterStatement struct + Alias string + Description string + Filter expr.Node + From string + Limit int + OrderBy Columns + Raw string + Where expr.Node + With u.JsonHelper + func MustParseFilter(statement string) *FilterStatement + func MustParseFilters(statement string) []*FilterStatement + func NewFilterStatement() *FilterStatement + func ParseFilterQL(filter string) (*FilterStatement, error) + func ParseFilters(statement string) (stmts []*FilterStatement, err error) + func (m *FilterStatement) Equal(s *FilterStatement) bool + func (m *FilterStatement) FingerPrintID() int64 + func (m *FilterStatement) Includes() []string + func (m *FilterStatement) String() string + func (m *FilterStatement) WriteDialect(w expr.DialectWriter) + type KvInt struct + K string + V int32 + XXX_unrecognized []byte + func (*KvInt) Descriptor() ([]byte, []int) + func (*KvInt) ProtoMessage() + func (m *KvInt) GetK() string + func (m *KvInt) GetV() int32 + func (m *KvInt) Marshal() (data []byte, err error) + func (m *KvInt) MarshalTo(data []byte) (int, error) + func (m *KvInt) Reset() + func (m *KvInt) Size() (n int) + func (m *KvInt) String() string + func (m *KvInt) Unmarshal(data []byte) error + type ParseError struct + type PreparedStatement struct + Alias string + Statement SqlStatement + func NewPreparedStatement() *PreparedStatement + func (m *PreparedStatement) Keyword() lex.TokenType + func (m *PreparedStatement) String() string + func (m *PreparedStatement) WriteDialect(w expr.DialectWriter) + type Projection struct + Columns ResultColumns + Distinct bool + Final bool + func NewProjection() *Projection + func ProjectionFromPb(pb *ProjectionPb) *Projection + func (m *Projection) AddColumn(col *Column, vt value.ValueType) + func (m *Projection) AddColumnShort(colName string, vt value.ValueType) + func (m *Projection) Equal(s *Projection) bool + func (m *Projection) FromPB(pb *ProjectionPb) *Projection + func (m *Projection) ToPB() *ProjectionPb + type ProjectionPb struct + ColNames []string + Columns []*ResultColumnPb + Distinct bool + Final bool + XXX_unrecognized []byte + func (*ProjectionPb) Descriptor() ([]byte, []int) + func (*ProjectionPb) ProtoMessage() + func (m *ProjectionPb) GetColNames() []string + func (m *ProjectionPb) GetColumns() []*ResultColumnPb + func (m *ProjectionPb) GetDistinct() bool + func (m *ProjectionPb) GetFinal() bool + func (m *ProjectionPb) Marshal() (data []byte, err error) + func (m *ProjectionPb) MarshalTo(data []byte) (int, error) + func (m *ProjectionPb) Reset() + func (m *ProjectionPb) Size() (n int) + func (m *ProjectionPb) String() string + func (m *ProjectionPb) Unmarshal(data []byte) error + type ResultColumn struct + As string + Col *Column + ColPos int + Final bool + Name string + Star bool + Type value.ValueType + func NewResultColumn(as string, ordinal int, col *Column, valtype value.ValueType) *ResultColumn + func (m *ResultColumn) Equal(s *ResultColumn) bool + func (m *ResultColumn) SourceName() string + type ResultColumnPb struct + As string + ColPos int32 + Column *ColumnPb + Final *bool + Name string + Star *bool + ValueType int32 + XXX_unrecognized []byte + func (*ResultColumnPb) Descriptor() ([]byte, []int) + func (*ResultColumnPb) ProtoMessage() + func (m *ResultColumnPb) GetAs() string + func (m *ResultColumnPb) GetColPos() int32 + func (m *ResultColumnPb) GetColumn() *ColumnPb + func (m *ResultColumnPb) GetFinal() bool + func (m *ResultColumnPb) GetName() string + func (m *ResultColumnPb) GetStar() bool + func (m *ResultColumnPb) GetValueType() int32 + func (m *ResultColumnPb) Marshal() (data []byte, err error) + func (m *ResultColumnPb) MarshalTo(data []byte) (int, error) + func (m *ResultColumnPb) Reset() + func (m *ResultColumnPb) Size() (n int) + func (m *ResultColumnPb) String() string + func (m *ResultColumnPb) Unmarshal(data []byte) error + type ResultColumns []*ResultColumn + type SqlAlter struct + Cols []*DdlColumn + Identity string + Raw string + Tok lex.Token + func (m *SqlAlter) FingerPrint(r rune) string + func (m *SqlAlter) Keyword() lex.TokenType + func (m *SqlAlter) String() string + func (m *SqlAlter) WriteDialect(w expr.DialectWriter) + type SqlCommand struct + Columns CommandColumns + Identity string + Value expr.Node + func (m *SqlCommand) FingerPrint(r rune) string + func (m *SqlCommand) Keyword() lex.TokenType + func (m *SqlCommand) String() string + func (m *SqlCommand) WriteDialect(w expr.DialectWriter) + type SqlCreate struct + Cols []*DdlColumn + Engine map[string]interface{} + Identity string + IfNotExists bool + OrReplace bool + Raw string + Select *SqlSelect + Tok lex.Token + With u.JsonHelper + func NewSqlCreate() *SqlCreate + func (m *SqlCreate) FingerPrint(r rune) string + func (m *SqlCreate) Keyword() lex.TokenType + func (m *SqlCreate) String() string + func (m *SqlCreate) WriteDialect(w expr.DialectWriter) + type SqlDelete struct + Limit int + Table string + Where *SqlWhere + func NewSqlDelete() *SqlDelete + func (m *SqlDelete) Keyword() lex.TokenType + func (m *SqlDelete) SqlSelect() *SqlSelect + func (m *SqlDelete) String() string + func (m *SqlDelete) WriteDialect(w expr.DialectWriter) + type SqlDescribe struct + Identity string + Raw string + Stmt SqlStatement + Tok lex.Token + func (m *SqlDescribe) Keyword() lex.TokenType + func (m *SqlDescribe) String() string + func (m *SqlDescribe) WriteDialect(w expr.DialectWriter) + type SqlDrop struct + Identity string + Raw string + Temp bool + Tok lex.Token + With u.JsonHelper + func NewSqlDrop() *SqlDrop + func (m *SqlDrop) FingerPrint(r rune) string + func (m *SqlDrop) Keyword() lex.TokenType + func (m *SqlDrop) String() string + func (m *SqlDrop) WriteDialect(w expr.DialectWriter) + type SqlInsert struct + Columns Columns + Rows [][]*ValueColumn + Select *SqlSelect + Table string + func NewSqlInsert() *SqlInsert + func (m *SqlInsert) ColumnNames() []string + func (m *SqlInsert) Keyword() lex.TokenType + func (m *SqlInsert) RewriteAsPrepareable(maxRows int, mark byte) string + func (m *SqlInsert) String() string + func (m *SqlInsert) WriteDialect(w expr.DialectWriter) + type SqlInto struct + Table string + func NewSqlInto(table string) *SqlInto + func (m *SqlInto) Equal(s *SqlInto) bool + func (m *SqlInto) Keyword() lex.TokenType + func (m *SqlInto) String() string + func (m *SqlInto) WriteDialect(w expr.DialectWriter) + type SqlSelect struct + Alias string + Columns Columns + Db string + Distinct bool + From []*SqlSource + GroupBy Columns + Having expr.Node + Into *SqlInto + Limit int + Offset int + OrderBy Columns + Raw string + Star bool + Where *SqlWhere + With u.JsonHelper + func NewSqlSelect() *SqlSelect + func ParseSqlSelect(sqlQuery string) (*SqlSelect, error) + func ParseSqlSelectResolver(sqlQuery string, fr expr.FuncResolver) (*SqlSelect, error) + func RewriteSqlSource(m *SqlSource, parentStmt *SqlSelect) *SqlSelect + func SqlSelectFromPb(pb *SqlSelectPb) *SqlSelect + func (m *SqlSelect) AddColumn(colArg Column) error + func (m *SqlSelect) AliasedColumns() map[string]*Column + func (m *SqlSelect) ColIndexes() map[string]int + func (m *SqlSelect) Copy() *SqlSelect + func (m *SqlSelect) CountStar() bool + func (m *SqlSelect) Equal(ss SqlStatement) bool + func (m *SqlSelect) Finalize() error + func (m *SqlSelect) FingerPrintID() int64 + func (m *SqlSelect) FromPB(spb *SqlSelectPb) *SqlSelect + func (m *SqlSelect) IsAggQuery() bool + func (m *SqlSelect) IsLiteral() bool + func (m *SqlSelect) Keyword() lex.TokenType + func (m *SqlSelect) Rewrite() + func (m *SqlSelect) RewriteAsRawSelect() + func (m *SqlSelect) SetSystemQry() + func (m *SqlSelect) String() string + func (m *SqlSelect) SystemQry() bool + func (m *SqlSelect) ToPB() *SqlSelectPb + func (m *SqlSelect) ToPbStatement() *SqlStatementPb + func (m *SqlSelect) UnAliasedColumns() map[string]*Column + func (m *SqlSelect) WriteDialect(w expr.DialectWriter) + type SqlSelectPb struct + Alias *string + Columns []*ColumnPb + Db string + Distinct bool + Finalized bool + From []*SqlSourcePb + GroupBy []*ColumnPb + Having *expr.NodePb + Into *string + IsAgg bool + Limit int32 + Offset int32 + OrderBy []*ColumnPb + Projection *ProjectionPb + Raw string + Schemaqry bool + Star bool + Where *SqlWherePb + With []byte + XXX_unrecognized []byte + func SqlSelectToPb(m *SqlSelect) *SqlSelectPb + func (*SqlSelectPb) Descriptor() ([]byte, []int) + func (*SqlSelectPb) ProtoMessage() + func (m *SqlSelectPb) GetAlias() string + func (m *SqlSelectPb) GetColumns() []*ColumnPb + func (m *SqlSelectPb) GetDb() string + func (m *SqlSelectPb) GetDistinct() bool + func (m *SqlSelectPb) GetFinalized() bool + func (m *SqlSelectPb) GetFrom() []*SqlSourcePb + func (m *SqlSelectPb) GetGroupBy() []*ColumnPb + func (m *SqlSelectPb) GetHaving() *expr.NodePb + func (m *SqlSelectPb) GetInto() string + func (m *SqlSelectPb) GetIsAgg() bool + func (m *SqlSelectPb) GetLimit() int32 + func (m *SqlSelectPb) GetOffset() int32 + func (m *SqlSelectPb) GetOrderBy() []*ColumnPb + func (m *SqlSelectPb) GetProjection() *ProjectionPb + func (m *SqlSelectPb) GetRaw() string + func (m *SqlSelectPb) GetSchemaqry() bool + func (m *SqlSelectPb) GetStar() bool + func (m *SqlSelectPb) GetWhere() *SqlWherePb + func (m *SqlSelectPb) GetWith() []byte + func (m *SqlSelectPb) Marshal() (data []byte, err error) + func (m *SqlSelectPb) MarshalTo(data []byte) (int, error) + func (m *SqlSelectPb) Reset() + func (m *SqlSelectPb) Size() (n int) + func (m *SqlSelectPb) String() string + func (m *SqlSelectPb) Unmarshal(data []byte) error + type SqlShow struct + Create bool + CreateWhat string + Db string + From string + Full bool + Identity string + Like expr.Node + Raw string + Scope string + ShowType string + Where expr.Node + func (m *SqlShow) Keyword() lex.TokenType + func (m *SqlShow) String() string + func (m *SqlShow) WriteDialect(w expr.DialectWriter) + type SqlSource struct + Alias string + JoinExpr expr.Node + JoinType lex.TokenType + LeftOrRight lex.TokenType + Name string + Op lex.TokenType + Raw string + Schema string + Seekable bool + Source *SqlSelect + SubQuery *SqlSelect + func NewSqlSource(table string) *SqlSource + func SqlSourceFromPb(pb *SqlSourcePb) *SqlSource + func (m *SqlSource) BuildColIndex(colNames []string) error + func (m *SqlSource) ColumnPositions() map[string]int + func (m *SqlSource) Equal(s *SqlSource) bool + func (m *SqlSource) Finalize() error + func (m *SqlSource) FromPB(n *SqlSourcePb) *SqlSource + func (m *SqlSource) IsLiteral() bool + func (m *SqlSource) JoinNodes() []expr.Node + func (m *SqlSource) Keyword() lex.TokenType + func (m *SqlSource) Rewrite(parentStmt *SqlSelect) *SqlSelect + func (m *SqlSource) SourceName() string + func (m *SqlSource) String() string + func (m *SqlSource) ToPB() *SqlSourcePb + func (m *SqlSource) UnAliasedColumns() map[string]*Column + func (m *SqlSource) WriteDialect(w expr.DialectWriter) + type SqlSourcePb struct + Alias string + AliasInner *string + ColIndex []KvInt + Columns []*ColumnPb + Final bool + JoinExpr *expr.NodePb + JoinNodes []*expr.NodePb + JoinType int32 + LeftOrRight int32 + Name string + Op int32 + Raw string + Seekable bool + Source *SqlSelectPb + SubQuery *SqlSelectPb + XXX_unrecognized []byte + func (*SqlSourcePb) Descriptor() ([]byte, []int) + func (*SqlSourcePb) ProtoMessage() + func (m *SqlSourcePb) GetAlias() string + func (m *SqlSourcePb) GetAliasInner() string + func (m *SqlSourcePb) GetColIndex() []KvInt + func (m *SqlSourcePb) GetColumns() []*ColumnPb + func (m *SqlSourcePb) GetFinal() bool + func (m *SqlSourcePb) GetJoinExpr() *expr.NodePb + func (m *SqlSourcePb) GetJoinNodes() []*expr.NodePb + func (m *SqlSourcePb) GetJoinType() int32 + func (m *SqlSourcePb) GetLeftOrRight() int32 + func (m *SqlSourcePb) GetName() string + func (m *SqlSourcePb) GetOp() int32 + func (m *SqlSourcePb) GetRaw() string + func (m *SqlSourcePb) GetSeekable() bool + func (m *SqlSourcePb) GetSource() *SqlSelectPb + func (m *SqlSourcePb) GetSubQuery() *SqlSelectPb + func (m *SqlSourcePb) Marshal() (data []byte, err error) + func (m *SqlSourcePb) MarshalTo(data []byte) (int, error) + func (m *SqlSourcePb) Reset() + func (m *SqlSourcePb) Size() (n int) + func (m *SqlSourcePb) String() string + func (m *SqlSourcePb) Unmarshal(data []byte) error + type SqlSourceStatement interface + Keyword func() lex.TokenType + String func() string + WriteDialect func(w expr.DialectWriter) + type SqlStatement interface + Keyword func() lex.TokenType + String func() string + WriteDialect func(w expr.DialectWriter) + func ParseSql(sqlQuery string) (SqlStatement, error) + func ParseSqlStatements(sqlQuery string) ([]SqlStatement, error) + func SqlFromPb(pb []byte) (SqlStatement, error) + type SqlStatementPb struct + Projection *ProjectionPb + Select *SqlSelectPb + Source *SqlSourcePb + XXX_unrecognized []byte + func (*SqlStatementPb) Descriptor() ([]byte, []int) + func (*SqlStatementPb) ProtoMessage() + func (m *SqlStatementPb) GetProjection() *ProjectionPb + func (m *SqlStatementPb) GetSelect() *SqlSelectPb + func (m *SqlStatementPb) GetSource() *SqlSourcePb + func (m *SqlStatementPb) Marshal() (data []byte, err error) + func (m *SqlStatementPb) MarshalTo(data []byte) (int, error) + func (m *SqlStatementPb) Reset() + func (m *SqlStatementPb) Size() (n int) + func (m *SqlStatementPb) String() string + func (m *SqlStatementPb) Unmarshal(data []byte) error + type SqlTokenPager struct + func NewSqlTokenPager(l *lex.Lexer) *SqlTokenPager + func (m *SqlTokenPager) ClauseEnd() bool + func (m *SqlTokenPager) IsEnd() bool + type SqlUpdate struct + Table string + Values map[string]*ValueColumn + Where *SqlWhere + func NewSqlUpdate() *SqlUpdate + func (m *SqlUpdate) Keyword() lex.TokenType + func (m *SqlUpdate) SqlSelect() *SqlSelect + func (m *SqlUpdate) String() string + func (m *SqlUpdate) WriteDialect(w expr.DialectWriter) + type SqlUpsert struct + Columns Columns + Rows [][]*ValueColumn + Table string + Values map[string]*ValueColumn + Where *SqlWhere + func NewSqlUpsert() *SqlUpsert + func (m *SqlUpsert) Keyword() lex.TokenType + func (m *SqlUpsert) SqlSelect() *SqlSelect + func (m *SqlUpsert) String() string + func (m *SqlUpsert) WriteDialect(w expr.DialectWriter) + type SqlWhere struct + Expr expr.Node + Op lex.TokenType + Source *SqlSelect + func NewSqlWhere(where expr.Node) *SqlWhere + func SqlWhereFromPb(pb *SqlWherePb) *SqlWhere + func (m *SqlWhere) Equal(s *SqlWhere) bool + func (m *SqlWhere) Keyword() lex.TokenType + func (m *SqlWhere) String() string + func (m *SqlWhere) WriteDialect(w expr.DialectWriter) + type SqlWherePb struct + Expr *expr.NodePb + Op int32 + Source *SqlSelectPb + XXX_unrecognized []byte + func SqlWhereToPb(m *SqlWhere) *SqlWherePb + func (*SqlWherePb) Descriptor() ([]byte, []int) + func (*SqlWherePb) ProtoMessage() + func (m *SqlWherePb) GetExpr() *expr.NodePb + func (m *SqlWherePb) GetOp() int32 + func (m *SqlWherePb) GetSource() *SqlSelectPb + func (m *SqlWherePb) Marshal() (data []byte, err error) + func (m *SqlWherePb) MarshalTo(data []byte) (int, error) + func (m *SqlWherePb) Reset() + func (m *SqlWherePb) Size() (n int) + func (m *SqlWherePb) String() string + func (m *SqlWherePb) Unmarshal(data []byte) error + type Sqlbridge struct + type ValueColumn struct + Expr expr.Node + Value value.Value