Documentation
¶
Overview ¶
AST Structures and Parsers for the SQL, and FilterQL, and Expression dialects.
Package rel is a generated protocol buffer package. It is generated from these files: sql.proto It has these top-level messages: SqlStatementPb SqlSelectPb SqlSourcePb SqlWherePb ProjectionPb ResultColumnPb KvInt ColumnPb CommandColumnPb
Index ¶
- Variables
- func MapIntFromPb(kv []KvInt) map[string]int
- 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)
- type Column
- 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) FingerPrint(r rune) string
- func (m *Column) InFinalProjection() bool
- func (m *Column) Key() string
- func (m *Column) LeftRight() (string, string, bool)
- func (m *Column) String() string
- func (m *Column) ToPB() *ColumnPb
- type ColumnPb
- func (*ColumnPb) Descriptor() ([]byte, []int)
- 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 (*ColumnPb) ProtoMessage()
- func (m *ColumnPb) Reset()
- func (m *ColumnPb) Size() (n int)
- func (m *ColumnPb) String() string
- func (m *ColumnPb) Unmarshal(data []byte) error
- type 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) FingerPrint(r rune) string
- func (m *Columns) String() string
- func (m *Columns) UnAliasedFieldNames() []string
- type ColumnsStatement
- type CommandColumn
- type CommandColumnPb
- func (*CommandColumnPb) Descriptor() ([]byte, []int)
- 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 (*CommandColumnPb) ProtoMessage()
- func (m *CommandColumnPb) Reset()
- func (m *CommandColumnPb) Size() (n int)
- func (m *CommandColumnPb) String() string
- func (m *CommandColumnPb) Unmarshal(data []byte) error
- type CommandColumns
- type Filter
- type FilterExpr
- type FilterSelect
- type FilterStatement
- type Filters
- type KvInt
- func (*KvInt) Descriptor() ([]byte, []int)
- 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 (*KvInt) ProtoMessage()
- func (m *KvInt) Reset()
- func (m *KvInt) Size() (n int)
- func (m *KvInt) String() string
- func (m *KvInt) Unmarshal(data []byte) error
- type PreparedStatement
- type Projection
- type ProjectionPb
- func (*ProjectionPb) Descriptor() ([]byte, []int)
- 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 (*ProjectionPb) ProtoMessage()
- func (m *ProjectionPb) Reset()
- func (m *ProjectionPb) Size() (n int)
- func (m *ProjectionPb) String() string
- func (m *ProjectionPb) Unmarshal(data []byte) error
- type ResultColumn
- type ResultColumnPb
- func (*ResultColumnPb) Descriptor() ([]byte, []int)
- 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 (*ResultColumnPb) ProtoMessage()
- func (m *ResultColumnPb) Reset()
- func (m *ResultColumnPb) Size() (n int)
- func (m *ResultColumnPb) String() string
- func (m *ResultColumnPb) Unmarshal(data []byte) error
- type ResultColumns
- type SqlCommand
- type SqlDelete
- type SqlDescribe
- type SqlInsert
- type SqlInto
- type 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) CountStar() bool
- func (m *SqlSelect) Equal(ss SqlStatement) bool
- func (m *SqlSelect) Finalize() error
- func (m *SqlSelect) FingerPrint(r rune) string
- 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) 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
- type SqlSelectPb
- func (*SqlSelectPb) Descriptor() ([]byte, []int)
- 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 (*SqlSelectPb) ProtoMessage()
- func (m *SqlSelectPb) Reset()
- func (m *SqlSelectPb) Size() (n int)
- func (m *SqlSelectPb) String() string
- func (m *SqlSelectPb) Unmarshal(data []byte) error
- type SqlShow
- type 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) FingerPrint(r rune) string
- 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
- type SqlSourcePb
- func (*SqlSourcePb) Descriptor() ([]byte, []int)
- 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 (*SqlSourcePb) ProtoMessage()
- func (m *SqlSourcePb) Reset()
- func (m *SqlSourcePb) Size() (n int)
- func (m *SqlSourcePb) String() string
- func (m *SqlSourcePb) Unmarshal(data []byte) error
- type SqlSourceStatement
- type SqlStatement
- type SqlStatementPb
- func (*SqlStatementPb) Descriptor() ([]byte, []int)
- 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 (*SqlStatementPb) ProtoMessage()
- func (m *SqlStatementPb) Reset()
- func (m *SqlStatementPb) Size() (n int)
- func (m *SqlStatementPb) String() string
- func (m *SqlStatementPb) Unmarshal(data []byte) error
- type SqlTokenPager
- type SqlUpdate
- type SqlUpsert
- type SqlWhere
- type SqlWherePb
- func (*SqlWherePb) Descriptor() ([]byte, []int)
- 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 (*SqlWherePb) ProtoMessage()
- func (m *SqlWherePb) Reset()
- func (m *SqlWherePb) Size() (n int)
- func (m *SqlWherePb) String() string
- func (m *SqlWherePb) Unmarshal(data []byte) error
- type Sqlbridge
- type ValueColumn
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthSql = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSql = fmt.Errorf("proto: integer overflow") )
Functions ¶
func MapIntFromPb ¶
func ParseJsonArray ¶
func ParseJsonArray(pg expr.TokenPager) ([]interface{}, error)
func ParseJsonObject ¶
func ParseJsonObject(pg expr.TokenPager, jh u.JsonHelper) error
func ParseKeyValue ¶
func ParseKeyValue(pg expr.TokenPager, jh u.JsonHelper) error
func ParseWith ¶
func ParseWith(pg expr.TokenPager) (u.JsonHelper, error)
Types ¶
type Column ¶
type Column struct {
ParentIndex int // slice idx position in parent query cols
Index int // slice idx position in original query cols
SourceIndex int // slice idx position in source []driver.Value
SourceField string // field name of underlying field
As string // As field, auto-populate the Field Name if exists
Comment string // optional in-line comments
Order string // (ASC | DESC)
Star bool // *
Agg bool // aggregate function column? count(*), avg(x) etc
Expr expr.Node // Expression, optional, often Identity.Node
Guard expr.Node // column If guard, non-standard sql column guard
// contains filtered or unexported fields
}
Column represents the Column as expressed in a [SELECT] expression
func NewColumnFromToken ¶
func NewColumnValue ¶
func (*Column) CopyRewrite ¶
Create a new copy of this column for rewrite purposes re-alias
func (*Column) FingerPrint ¶
func (*Column) InFinalProjection ¶
type ColumnPb ¶
type ColumnPb struct {
SourceQuote []byte `protobuf:"bytes,1,opt,name=sourceQuote" json:"sourceQuote,omitempty"`
AsQuoteByte []byte `protobuf:"bytes,2,opt,name=asQuoteByte" json:"asQuoteByte,omitempty"`
OriginalAs *string `protobuf:"bytes,3,opt,name=originalAs" json:"originalAs,omitempty"`
Left *string `protobuf:"bytes,4,opt,name=left" json:"left,omitempty"`
Right *string `protobuf:"bytes,5,opt,name=right" json:"right,omitempty"`
ParentIndex int32 `protobuf:"varint,6,opt,name=parentIndex" json:"parentIndex"`
Index int32 `protobuf:"varint,7,opt,name=index" json:"index"`
SourceIndex int32 `protobuf:"varint,8,opt,name=sourceIndex" json:"sourceIndex"`
SourceField *string `protobuf:"bytes,9,opt,name=sourceField" json:"sourceField,omitempty"`
As string `protobuf:"bytes,11,opt,name=as" json:"as"`
Comment *string `protobuf:"bytes,12,opt,name=comment" json:"comment,omitempty"`
Order *string `protobuf:"bytes,13,opt,name=order" json:"order,omitempty"`
Star *bool `protobuf:"varint,14,opt,name=star" json:"star,omitempty"`
Agg bool `protobuf:"varint,15,opt,name=agg" json:"agg"`
Expr *expr.NodePb `protobuf:"bytes,16,opt,name=Expr,json=expr" json:"Expr,omitempty"`
Guard *expr.NodePb `protobuf:"bytes,17,opt,name=Guard,json=guard" json:"Guard,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func ColumnsToPb ¶
func (*ColumnPb) Descriptor ¶
func (*ColumnPb) GetAsQuoteByte ¶
func (*ColumnPb) GetComment ¶
func (*ColumnPb) GetOriginalAs ¶
func (*ColumnPb) GetParentIndex ¶
func (*ColumnPb) GetSourceField ¶
func (*ColumnPb) GetSourceIndex ¶
func (*ColumnPb) GetSourceQuote ¶
func (*ColumnPb) ProtoMessage ¶
func (*ColumnPb) ProtoMessage()
type Columns ¶
type Columns []*Column
List of Columns in SELECT [columns]
func ColumnsFromPb ¶
func (*Columns) AliasedFieldNames ¶
func (*Columns) FieldNames ¶
func (*Columns) FingerPrint ¶
func (*Columns) UnAliasedFieldNames ¶
type ColumnsStatement ¶
type CommandColumn ¶
type CommandColumn struct {
Expr expr.Node // column expression
Name string // Original path/name for command field
}
Command column is single column such as "autocommit"
func (*CommandColumn) FingerPrint ¶
func (m *CommandColumn) FingerPrint(r rune) string
func (*CommandColumn) Key ¶
func (m *CommandColumn) Key() string
func (*CommandColumn) String ¶
func (m *CommandColumn) String() string
type CommandColumnPb ¶
type CommandColumnPb struct {
Expr *expr.NodePb `protobuf:"bytes,1,opt,name=Expr,json=expr" json:"Expr,omitempty"`
Name string `protobuf:"bytes,2,req,name=name" json:"name"`
XXX_unrecognized []byte `json:"-"`
}
func (*CommandColumnPb) Descriptor ¶
func (*CommandColumnPb) Descriptor() ([]byte, []int)
func (*CommandColumnPb) GetExpr ¶
func (m *CommandColumnPb) GetExpr() *expr.NodePb
func (*CommandColumnPb) GetName ¶
func (m *CommandColumnPb) GetName() string
func (*CommandColumnPb) Marshal ¶
func (m *CommandColumnPb) Marshal() (data []byte, err error)
func (*CommandColumnPb) ProtoMessage ¶
func (*CommandColumnPb) ProtoMessage()
func (*CommandColumnPb) Reset ¶
func (m *CommandColumnPb) Reset()
func (*CommandColumnPb) Size ¶
func (m *CommandColumnPb) Size() (n int)
func (*CommandColumnPb) String ¶
func (m *CommandColumnPb) String() string
func (*CommandColumnPb) Unmarshal ¶
func (m *CommandColumnPb) Unmarshal(data []byte) error
type CommandColumns ¶
type CommandColumns []*CommandColumn
SQL commands such as:
set autocommit SET @@local.sort_buffer_size=10000; USE myschema;
func (*CommandColumns) FingerPrint ¶
func (m *CommandColumns) FingerPrint(r rune) string
func (*CommandColumns) String ¶
func (m *CommandColumns) String() string
type FilterExpr ¶
type FilterExpr struct {
IncludeFilter *FilterStatement // Memoized Include
// Do we negate this entire Filter? Default = false (ie, don't negate)
// This should NOT be available to Expr nodes which have their own built
// in negation/urnary
Negate bool
// Exactly one of these will be non-nil
Include string // name of foreign named alias filter to embed
Expr expr.Node // Node might be nil in which case must have filter
Filter *Filters // might be nil, must have expr
MatchAll bool // * = match all
}
Single Filter expression
func NewFilterExpr ¶
func NewFilterExpr() *FilterExpr
func (*FilterExpr) Includes ¶
func (fe *FilterExpr) Includes() []string
Recurse this expression and find all includes
func (*FilterExpr) String ¶
func (fe *FilterExpr) String() string
String representation of FilterExpression for diagnostic purposes.
type FilterSelect ¶
type FilterSelect struct {
*FilterStatement
Columns Columns
}
func NewFilterSelect ¶
func NewFilterSelect() *FilterSelect
func ParseFilterSelect ¶
func ParseFilterSelect(query string) (*FilterSelect, error)
func (*FilterSelect) AddColumn ¶
func (m *FilterSelect) AddColumn(colArg Column) error
func (*FilterSelect) FingerPrint ¶
func (m *FilterSelect) FingerPrint(r rune) string
func (*FilterSelect) FingerPrintID ¶
func (m *FilterSelect) FingerPrintID() int64
func (*FilterSelect) Includes ¶
func (m *FilterSelect) Includes() []string
Recurse this statement and find all includes
func (*FilterSelect) String ¶
func (m *FilterSelect) String() string
String representation of FilterSelect
type FilterStatement ¶
type FilterStatement struct {
Description string // initial pre-start comments
Raw string // full original raw statement
Filter *Filters // A top level filter
From string // From is optional
Limit int // Limit
HasDateMath bool // does this have date math?
Alias string // Non-Standard sql, alias/name of sql another way of expression Prepared Statement
With u.JsonHelper // Non-Standard SQL for properties/config info, similar to Cassandra with, purse json
}
Filter Statement is a statement of type = Filter
func NewFilterStatement ¶
func NewFilterStatement() *FilterStatement
func ParseFilterQL ¶
func ParseFilterQL(filter string) (*FilterStatement, error)
Parses Tokens and returns an request.
func ParseFilterQLVm ¶
func ParseFilterQLVm(filter string) (*FilterStatement, error)
func (*FilterStatement) FingerPrint ¶
func (m *FilterStatement) FingerPrint(r rune) string
func (*FilterStatement) FingerPrintID ¶
func (m *FilterStatement) FingerPrintID() int64
func (*FilterStatement) Includes ¶
func (m *FilterStatement) Includes() []string
Recurse this statement and find all includes
func (*FilterStatement) String ¶
func (m *FilterStatement) String() string
String representation of FilterStatement
type Filters ¶
type Filters struct {
Negate bool // Should we negate this response?
Op lex.TokenType // OR, AND
Filters []*FilterExpr
}
A list of Filter Expressions
func NewFilters ¶
type KvInt ¶
type KvInt struct {
K string `protobuf:"bytes,1,req,name=k" json:"k"`
V int32 `protobuf:"varint,2,req,name=v" json:"v"`
XXX_unrecognized []byte `json:"-"`
}
func (*KvInt) Descriptor ¶
func (*KvInt) ProtoMessage ¶
func (*KvInt) ProtoMessage()
type PreparedStatement ¶
type PreparedStatement struct {
Alias string
Statement SqlStatement
}
Prepared/Aliased SQL statement
func NewPreparedStatement ¶
func NewPreparedStatement() *PreparedStatement
func (*PreparedStatement) FingerPrint ¶
func (m *PreparedStatement) FingerPrint(r rune) string
func (*PreparedStatement) Keyword ¶
func (m *PreparedStatement) Keyword() lex.TokenType
func (*PreparedStatement) String ¶
func (m *PreparedStatement) String() string
type Projection ¶
type Projection struct {
Distinct bool
Final bool // Is this a Final Projection? or intermiediate?
Columns ResultColumns
// contains filtered or unexported fields
}
Projection describes the results to expect from sql statement ie the ResultColumns for a result-set
func NewProjection ¶
func NewProjection() *Projection
func ProjectionFromPb ¶
func ProjectionFromPb(pb *ProjectionPb) *Projection
func (*Projection) AddColumnShort ¶
func (m *Projection) AddColumnShort(colName string, vt value.ValueType)
func (*Projection) Equal ¶
func (m *Projection) Equal(s *Projection) bool
func (*Projection) FromPB ¶
func (m *Projection) FromPB(pb *ProjectionPb) *Projection
func (*Projection) ToPB ¶
func (m *Projection) ToPB() *ProjectionPb
type ProjectionPb ¶
type ProjectionPb struct {
Distinct bool `protobuf:"varint,1,req,name=distinct" json:"distinct"`
Final bool `protobuf:"varint,2,req,name=final" json:"final"`
ColNames []string `protobuf:"bytes,3,rep,name=colNames" json:"colNames,omitempty"`
Columns []*ResultColumnPb `protobuf:"bytes,4,rep,name=columns" json:"columns,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (*ProjectionPb) Descriptor ¶
func (*ProjectionPb) Descriptor() ([]byte, []int)
func (*ProjectionPb) GetColNames ¶
func (m *ProjectionPb) GetColNames() []string
func (*ProjectionPb) GetColumns ¶
func (m *ProjectionPb) GetColumns() []*ResultColumnPb
func (*ProjectionPb) GetDistinct ¶
func (m *ProjectionPb) GetDistinct() bool
func (*ProjectionPb) GetFinal ¶
func (m *ProjectionPb) GetFinal() bool
func (*ProjectionPb) Marshal ¶
func (m *ProjectionPb) Marshal() (data []byte, err error)
func (*ProjectionPb) ProtoMessage ¶
func (*ProjectionPb) ProtoMessage()
func (*ProjectionPb) Reset ¶
func (m *ProjectionPb) Reset()
func (*ProjectionPb) Size ¶
func (m *ProjectionPb) Size() (n int)
func (*ProjectionPb) String ¶
func (m *ProjectionPb) String() string
func (*ProjectionPb) Unmarshal ¶
func (m *ProjectionPb) Unmarshal(data []byte) error
type ResultColumn ¶
type ResultColumn struct {
Final bool // Is this part of final projection (ie, response)
Name string // Original path/name for query field
ColPos int // Ordinal position in sql (or partial sql) statement
Col *Column // the original sql column
Star bool // Was this a select * ??
As string // aliased
Type value.ValueType // Data Type
}
Result Column used in projection
func NewResultColumn ¶
func (*ResultColumn) Equal ¶
func (m *ResultColumn) Equal(s *ResultColumn) bool
type ResultColumnPb ¶
type ResultColumnPb struct {
Final *bool `protobuf:"varint,1,opt,name=final" json:"final,omitempty"`
Name string `protobuf:"bytes,2,req,name=name" json:"name"`
ColPos int32 `protobuf:"varint,3,req,name=colPos" json:"colPos"`
Column *ColumnPb `protobuf:"bytes,4,opt,name=column" json:"column,omitempty"`
Star *bool `protobuf:"varint,5,opt,name=star" json:"star,omitempty"`
As string `protobuf:"bytes,6,req,name=as" json:"as"`
ValueType int32 `protobuf:"varint,7,req,name=valueType" json:"valueType"`
XXX_unrecognized []byte `json:"-"`
}
func (*ResultColumnPb) Descriptor ¶
func (*ResultColumnPb) Descriptor() ([]byte, []int)
func (*ResultColumnPb) GetAs ¶
func (m *ResultColumnPb) GetAs() string
func (*ResultColumnPb) GetColPos ¶
func (m *ResultColumnPb) GetColPos() int32
func (*ResultColumnPb) GetColumn ¶
func (m *ResultColumnPb) GetColumn() *ColumnPb
func (*ResultColumnPb) GetFinal ¶
func (m *ResultColumnPb) GetFinal() bool
func (*ResultColumnPb) GetName ¶
func (m *ResultColumnPb) GetName() string
func (*ResultColumnPb) GetStar ¶
func (m *ResultColumnPb) GetStar() bool
func (*ResultColumnPb) GetValueType ¶
func (m *ResultColumnPb) GetValueType() int32
func (*ResultColumnPb) Marshal ¶
func (m *ResultColumnPb) Marshal() (data []byte, err error)
func (*ResultColumnPb) ProtoMessage ¶
func (*ResultColumnPb) ProtoMessage()
func (*ResultColumnPb) Reset ¶
func (m *ResultColumnPb) Reset()
func (*ResultColumnPb) Size ¶
func (m *ResultColumnPb) Size() (n int)
func (*ResultColumnPb) String ¶
func (m *ResultColumnPb) String() string
func (*ResultColumnPb) Unmarshal ¶
func (m *ResultColumnPb) Unmarshal(data []byte) error
type ResultColumns ¶
type ResultColumns []*ResultColumn
List of ResultColumns used to describe projection response columns
type SqlCommand ¶
type SqlCommand struct {
Columns CommandColumns // can have multiple columns in command
Identity string //
Value expr.Node //
// contains filtered or unexported fields
}
Sql Command is admin command such as "SET"
func (*SqlCommand) FingerPrint ¶
func (m *SqlCommand) FingerPrint(r rune) string
func (*SqlCommand) Keyword ¶
func (m *SqlCommand) Keyword() lex.TokenType
func (*SqlCommand) String ¶
func (m *SqlCommand) String() string
type SqlDelete ¶
SQL Delete Statement
func NewSqlDelete ¶
func NewSqlDelete() *SqlDelete
func (*SqlDelete) FingerPrint ¶
type SqlDescribe ¶
type SqlDescribe struct {
Raw string // full original raw statement
Identity string // Describe
Tok lex.Token // Explain, Describe, Desc
Stmt SqlStatement
}
SQL Describe statement
func (*SqlDescribe) FingerPrint ¶
func (m *SqlDescribe) FingerPrint(r rune) string
func (*SqlDescribe) Keyword ¶
func (m *SqlDescribe) Keyword() lex.TokenType
func (*SqlDescribe) String ¶
func (m *SqlDescribe) String() string
type SqlInsert ¶
type SqlInsert struct {
Table string // table name
Columns Columns // Column Names
Rows [][]*ValueColumn // Values to insert
Select *SqlSelect //
// contains filtered or unexported fields
}
SQL Insert Statement
func NewSqlInsert ¶
func NewSqlInsert() *SqlInsert
func (*SqlInsert) ColumnNames ¶
func (*SqlInsert) FingerPrint ¶
type SqlInto ¶
type SqlInto struct {
Table string
}
SQL INTO statement (select a,b,c from y INTO z)
func NewSqlInto ¶
func (*SqlInto) FingerPrint ¶
type SqlSelect ¶
type SqlSelect struct {
Db string // If provided a use "dbname"
Raw string // full original raw statement
Star bool // for select * from ...
Distinct bool // Distinct flag?
Columns Columns // An array (ordered) list of columns
From []*SqlSource // From, Join
Into *SqlInto // Into "table"
Where *SqlWhere // Expr Node, or *SqlSelect
Having expr.Node // Filter results
GroupBy Columns
OrderBy Columns
Limit int
Offset int
Alias string // Non-Standard sql, alias/name of sql another way of expression Prepared Statement
With u.JsonHelper // Non-Standard SQL for properties/config info, similar to Cassandra with, purse json
// contains filtered or unexported fields
}
SQL Select statement
func NewSqlSelect ¶
func NewSqlSelect() *SqlSelect
func ParseSqlSelect ¶
func ParseSqlSelectResolver ¶
func ParseSqlSelectResolver(sqlQuery string, fr expr.FuncResolver) (*SqlSelect, error)
func SqlSelectFromPb ¶
func SqlSelectFromPb(pb *SqlSelectPb) *SqlSelect
func (*SqlSelect) AliasedColumns ¶
func (*SqlSelect) ColIndexes ¶
func (*SqlSelect) Equal ¶
func (m *SqlSelect) Equal(ss SqlStatement) bool
func (*SqlSelect) Finalize ¶
Finalize this Query plan by preparing sub-sources
ie we need to rewrite some things into sub-statements - we need to share the join expression across sources
func (*SqlSelect) FingerPrint ¶
func (*SqlSelect) FingerPrintID ¶
func (*SqlSelect) FromPB ¶
func (m *SqlSelect) FromPB(spb *SqlSelectPb) *SqlSelect
func (*SqlSelect) IsAggQuery ¶
func (*SqlSelect) SetSystemQry ¶
func (m *SqlSelect) SetSystemQry()
func (*SqlSelect) ToPB ¶
func (m *SqlSelect) ToPB() *SqlSelectPb
func (*SqlSelect) ToPbStatement ¶
func (m *SqlSelect) ToPbStatement() *SqlStatementPb
func (*SqlSelect) UnAliasedColumns ¶
type SqlSelectPb ¶
type SqlSelectPb struct {
Db string `protobuf:"bytes,1,req,name=db" json:"db"`
Raw string `protobuf:"bytes,2,req,name=raw" json:"raw"`
Star bool `protobuf:"varint,3,req,name=star" json:"star"`
Distinct bool `protobuf:"varint,4,req,name=distinct" json:"distinct"`
Columns []*ColumnPb `protobuf:"bytes,5,rep,name=columns" json:"columns,omitempty"`
From []*SqlSourcePb `protobuf:"bytes,6,rep,name=from" json:"from,omitempty"`
Into *string `protobuf:"bytes,7,opt,name=into" json:"into,omitempty"`
Where *SqlWherePb `protobuf:"bytes,8,opt,name=where" json:"where,omitempty"`
Having *expr.NodePb `protobuf:"bytes,9,opt,name=having" json:"having,omitempty"`
GroupBy []*ColumnPb `protobuf:"bytes,11,rep,name=groupBy" json:"groupBy,omitempty"`
OrderBy []*ColumnPb `protobuf:"bytes,10,rep,name=orderBy" json:"orderBy,omitempty"`
Limit int32 `protobuf:"varint,12,opt,name=limit" json:"limit"`
Offset int32 `protobuf:"varint,13,opt,name=offset" json:"offset"`
Alias *string `protobuf:"bytes,14,opt,name=alias" json:"alias,omitempty"`
Projection *ProjectionPb `protobuf:"bytes,15,opt,name=projection" json:"projection,omitempty"`
IsAgg bool `protobuf:"varint,16,req,name=isAgg" json:"isAgg"`
Finalized bool `protobuf:"varint,17,req,name=finalized" json:"finalized"`
Schemaqry bool `protobuf:"varint,18,req,name=schemaqry" json:"schemaqry"`
With []byte `protobuf:"bytes,19,opt,name=with" json:"with,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func SqlSelectToPb ¶
func SqlSelectToPb(m *SqlSelect) *SqlSelectPb
func (*SqlSelectPb) Descriptor ¶
func (*SqlSelectPb) Descriptor() ([]byte, []int)
func (*SqlSelectPb) GetAlias ¶
func (m *SqlSelectPb) GetAlias() string
func (*SqlSelectPb) GetColumns ¶
func (m *SqlSelectPb) GetColumns() []*ColumnPb
func (*SqlSelectPb) GetDb ¶
func (m *SqlSelectPb) GetDb() string
func (*SqlSelectPb) GetDistinct ¶
func (m *SqlSelectPb) GetDistinct() bool
func (*SqlSelectPb) GetFinalized ¶
func (m *SqlSelectPb) GetFinalized() bool
func (*SqlSelectPb) GetFrom ¶
func (m *SqlSelectPb) GetFrom() []*SqlSourcePb
func (*SqlSelectPb) GetGroupBy ¶
func (m *SqlSelectPb) GetGroupBy() []*ColumnPb
func (*SqlSelectPb) GetHaving ¶
func (m *SqlSelectPb) GetHaving() *expr.NodePb
func (*SqlSelectPb) GetInto ¶
func (m *SqlSelectPb) GetInto() string
func (*SqlSelectPb) GetIsAgg ¶
func (m *SqlSelectPb) GetIsAgg() bool
func (*SqlSelectPb) GetLimit ¶
func (m *SqlSelectPb) GetLimit() int32
func (*SqlSelectPb) GetOffset ¶
func (m *SqlSelectPb) GetOffset() int32
func (*SqlSelectPb) GetOrderBy ¶
func (m *SqlSelectPb) GetOrderBy() []*ColumnPb
func (*SqlSelectPb) GetProjection ¶
func (m *SqlSelectPb) GetProjection() *ProjectionPb
func (*SqlSelectPb) GetRaw ¶
func (m *SqlSelectPb) GetRaw() string
func (*SqlSelectPb) GetSchemaqry ¶
func (m *SqlSelectPb) GetSchemaqry() bool
func (*SqlSelectPb) GetStar ¶
func (m *SqlSelectPb) GetStar() bool
func (*SqlSelectPb) GetWhere ¶
func (m *SqlSelectPb) GetWhere() *SqlWherePb
func (*SqlSelectPb) GetWith ¶
func (m *SqlSelectPb) GetWith() []byte
func (*SqlSelectPb) Marshal ¶
func (m *SqlSelectPb) Marshal() (data []byte, err error)
func (*SqlSelectPb) ProtoMessage ¶
func (*SqlSelectPb) ProtoMessage()
func (*SqlSelectPb) Reset ¶
func (m *SqlSelectPb) Reset()
func (*SqlSelectPb) Size ¶
func (m *SqlSelectPb) Size() (n int)
func (*SqlSelectPb) String ¶
func (m *SqlSelectPb) String() string
func (*SqlSelectPb) Unmarshal ¶
func (m *SqlSelectPb) Unmarshal(data []byte) error
type SqlShow ¶
type SqlShow struct {
Raw string // full raw statement
Db string // Database/Schema name
Full bool // SHOW FULL TABLE FROM
Scope string // {FULL, GLOBAL, SESSION}
ShowType string // object type, [tables, columns, etc]
From string // `table` or `schema`.`table`
Identity string // `table` or `schema`.`table`
Create bool
CreateWhat string
Where expr.Node
Like expr.Node
}
SQL SHOW Statement
func (*SqlShow) FingerPrint ¶
type SqlSource ¶
type SqlSource struct {
Source *SqlSelect // Sql Select Source query, written by Rewrite
Raw string // Raw Partial Query
Name string // From Name (optional, empty if join, subselect)
Alias string // From name aliased
Schema string // FROM `schema`.`table`
Op lex.TokenType // In, =, ON
LeftOrRight lex.TokenType // Left, Right
JoinType lex.TokenType // INNER, OUTER
JoinExpr expr.Node // Join expression x.y = q.y
SubQuery *SqlSelect // optional, Join/SubSelect statement
// Plan Hints, move to a dedicated planner
Seekable bool
// contains filtered or unexported fields
}
Source is a table name, sub-query, or join as used in SELECT <columns> FROM <SQLSOURCE>
- SELECT .. FROM table_name
- SELECT .. from (select a,b,c from tableb)
- SELECT .. FROM tablex INNER JOIN ...
func NewSqlSource ¶
func SqlSourceFromPb ¶
func SqlSourceFromPb(pb *SqlSourcePb) *SqlSource
func (*SqlSource) BuildColIndex ¶
func (*SqlSource) ColumnPositions ¶
Get a list of Column names to position
func (*SqlSource) FingerPrint ¶
func (*SqlSource) FromPB ¶
func (m *SqlSource) FromPB(n *SqlSourcePb) *SqlSource
func (*SqlSource) JoinNodes ¶
We need to be able to rewrite statements to convert a stmt such as:
FROM users AS u
INNER JOIN orders AS o
ON u.user_id = o.user_id
So that we can evaluate the Join Key on left/right
in this case, it is simple, just
=> user_id
or this one:
FROM users AS u
INNER JOIN orders AS o
ON LOWER(u.email) = LOWER(o.email)
=> LOWER(user_id)
func (*SqlSource) Rewrite ¶
Rewrite this Source to act as a stand-alone query to backend
@parentStmt = the parent statement that this a partial source to
func (*SqlSource) SourceName ¶
func (*SqlSource) ToPB ¶
func (m *SqlSource) ToPB() *SqlSourcePb
func (*SqlSource) UnAliasedColumns ¶
Get a list of Un-Aliased Columns, ie columns with column
names that have NOT yet been aliased
type SqlSourcePb ¶
type SqlSourcePb struct {
Final bool `protobuf:"varint,1,opt,name=final" json:"final"`
AliasInner *string `protobuf:"bytes,2,opt,name=aliasInner" json:"aliasInner,omitempty"`
Columns []*ColumnPb `protobuf:"bytes,3,rep,name=columns" json:"columns,omitempty"`
ColIndex []KvInt `protobuf:"bytes,4,rep,name=colIndex" json:"colIndex"`
JoinNodes []*expr.NodePb `protobuf:"bytes,5,rep,name=joinNodes" json:"joinNodes,omitempty"`
Source *SqlSelectPb `protobuf:"bytes,6,opt,name=source" json:"source,omitempty"`
Raw string `protobuf:"bytes,7,opt,name=raw" json:"raw"`
Name string `protobuf:"bytes,8,opt,name=name" json:"name"`
Alias string `protobuf:"bytes,9,opt,name=alias" json:"alias"`
Op int32 `protobuf:"varint,10,req,name=op" json:"op"`
LeftOrRight int32 `protobuf:"varint,11,req,name=leftOrRight" json:"leftOrRight"`
JoinType int32 `protobuf:"varint,12,req,name=joinType" json:"joinType"`
JoinExpr *expr.NodePb `protobuf:"bytes,13,opt,name=joinExpr" json:"joinExpr,omitempty"`
SubQuery *SqlSelectPb `protobuf:"bytes,14,opt,name=subQuery" json:"subQuery,omitempty"`
Seekable bool `protobuf:"varint,15,opt,name=seekable" json:"seekable"`
XXX_unrecognized []byte `json:"-"`
}
func (*SqlSourcePb) Descriptor ¶
func (*SqlSourcePb) Descriptor() ([]byte, []int)
func (*SqlSourcePb) GetAlias ¶
func (m *SqlSourcePb) GetAlias() string
func (*SqlSourcePb) GetAliasInner ¶
func (m *SqlSourcePb) GetAliasInner() string
func (*SqlSourcePb) GetColIndex ¶
func (m *SqlSourcePb) GetColIndex() []KvInt
func (*SqlSourcePb) GetColumns ¶
func (m *SqlSourcePb) GetColumns() []*ColumnPb
func (*SqlSourcePb) GetFinal ¶
func (m *SqlSourcePb) GetFinal() bool
func (*SqlSourcePb) GetJoinExpr ¶
func (m *SqlSourcePb) GetJoinExpr() *expr.NodePb
func (*SqlSourcePb) GetJoinNodes ¶
func (m *SqlSourcePb) GetJoinNodes() []*expr.NodePb
func (*SqlSourcePb) GetJoinType ¶
func (m *SqlSourcePb) GetJoinType() int32
func (*SqlSourcePb) GetLeftOrRight ¶
func (m *SqlSourcePb) GetLeftOrRight() int32
func (*SqlSourcePb) GetName ¶
func (m *SqlSourcePb) GetName() string
func (*SqlSourcePb) GetOp ¶
func (m *SqlSourcePb) GetOp() int32
func (*SqlSourcePb) GetRaw ¶
func (m *SqlSourcePb) GetRaw() string
func (*SqlSourcePb) GetSeekable ¶
func (m *SqlSourcePb) GetSeekable() bool
func (*SqlSourcePb) GetSource ¶
func (m *SqlSourcePb) GetSource() *SqlSelectPb
func (*SqlSourcePb) GetSubQuery ¶
func (m *SqlSourcePb) GetSubQuery() *SqlSelectPb
func (*SqlSourcePb) Marshal ¶
func (m *SqlSourcePb) Marshal() (data []byte, err error)
func (*SqlSourcePb) ProtoMessage ¶
func (*SqlSourcePb) ProtoMessage()
func (*SqlSourcePb) Reset ¶
func (m *SqlSourcePb) Reset()
func (*SqlSourcePb) Size ¶
func (m *SqlSourcePb) Size() (n int)
func (*SqlSourcePb) String ¶
func (m *SqlSourcePb) String() string
func (*SqlSourcePb) Unmarshal ¶
func (m *SqlSourcePb) Unmarshal(data []byte) error
type SqlSourceStatement ¶
type SqlSourceStatement interface {
// string representation of Node, AST parseable back to itself
String() string
// string representation of Node, AST but with values replaced by @rune (? generally)
// used to allow statements to be deterministically cached/prepared even without
// usage of keyword prepared
FingerPrint(r rune) string
Keyword() lex.TokenType
}
The sqlStatement interface, to define the subselect/join-types
Join, SubSelect, From
type SqlStatement ¶
type SqlStatement interface {
// string representation of Node, AST parseable back to itself
String() string
// string representation of Node, AST but with values replaced by @rune (? generally)
// used to allow statements to be deterministically cached/prepared even without
// usage of keyword prepared
FingerPrint(r rune) string
// SQL keyword (select, insert, etc)
Keyword() lex.TokenType
}
The sqlStatement interface, to define the sql statement
Select, Insert, Update, Delete, Command, Show, Describe etc
func ParseSql ¶
func ParseSql(sqlQuery string) (SqlStatement, error)
ParseSql Parses SqlStatement and returns a statement or error
- does not parse more than one statement
func ParseSqlStatements ¶
func ParseSqlStatements(sqlQuery string) ([]SqlStatement, error)
func ParseSqlVm ¶
func ParseSqlVm(sqlQuery string) (SqlStatement, error)
type SqlStatementPb ¶
type SqlStatementPb struct {
Select *SqlSelectPb `protobuf:"bytes,1,opt,name=select" json:"select,omitempty"`
Source *SqlSourcePb `protobuf:"bytes,2,opt,name=source" json:"source,omitempty"`
Projection *ProjectionPb `protobuf:"bytes,4,opt,name=projection" json:"projection,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
The generic SqlStatement, must be exactly one of these types
func (*SqlStatementPb) Descriptor ¶
func (*SqlStatementPb) Descriptor() ([]byte, []int)
func (*SqlStatementPb) GetProjection ¶
func (m *SqlStatementPb) GetProjection() *ProjectionPb
func (*SqlStatementPb) GetSelect ¶
func (m *SqlStatementPb) GetSelect() *SqlSelectPb
func (*SqlStatementPb) GetSource ¶
func (m *SqlStatementPb) GetSource() *SqlSourcePb
func (*SqlStatementPb) Marshal ¶
func (m *SqlStatementPb) Marshal() (data []byte, err error)
func (*SqlStatementPb) ProtoMessage ¶
func (*SqlStatementPb) ProtoMessage()
func (*SqlStatementPb) Reset ¶
func (m *SqlStatementPb) Reset()
func (*SqlStatementPb) Size ¶
func (m *SqlStatementPb) Size() (n int)
func (*SqlStatementPb) String ¶
func (m *SqlStatementPb) String() string
func (*SqlStatementPb) Unmarshal ¶
func (m *SqlStatementPb) Unmarshal(data []byte) error
type SqlTokenPager ¶
type SqlTokenPager struct {
*expr.LexTokenPager
// contains filtered or unexported fields
}
TokenPager is responsible for determining end of current tree (column, etc)
func NewSqlTokenPager ¶
func NewSqlTokenPager(l *lex.Lexer) *SqlTokenPager
func (*SqlTokenPager) ClauseEnd ¶
func (m *SqlTokenPager) ClauseEnd() bool
func (*SqlTokenPager) IsEnd ¶
func (m *SqlTokenPager) IsEnd() bool
type SqlUpdate ¶
type SqlUpdate struct {
Values map[string]*ValueColumn
Where *SqlWhere
Table string
}
SQL Update Statement
func NewSqlUpdate ¶
func NewSqlUpdate() *SqlUpdate
func (*SqlUpdate) FingerPrint ¶
type SqlUpsert ¶
type SqlUpsert struct {
Columns Columns
Rows [][]*ValueColumn
Values map[string]*ValueColumn
Where *SqlWhere
Table string
}
SQL Upsert Statement
func NewSqlUpsert ¶
func NewSqlUpsert() *SqlUpsert
func (*SqlUpsert) FingerPrint ¶
type SqlWhere ¶
type SqlWhere struct {
// Either Op + Source exists
Op lex.TokenType // (In|=|ON) for Select Clauses operators
Source *SqlSelect // IN (SELECT a,b,c from z)
// OR expr but not both
Expr expr.Node // x = y AND q > 5
}
WHERE is select stmt, or set of expressions - WHERE x in (select name from q) - WHERE x = y - WHERE x = y AND z = q - WHERE tolower(x) IN (select name from q)
func NewSqlWhere ¶
func SqlWhereFromPb ¶
func SqlWhereFromPb(pb *SqlWherePb) *SqlWhere
func (*SqlWhere) FingerPrint ¶
type SqlWherePb ¶
type SqlWherePb struct {
Op int32 `protobuf:"varint,1,req,name=op" json:"op"`
Source *SqlSelectPb `protobuf:"bytes,2,opt,name=source" json:"source,omitempty"`
Expr *expr.NodePb `protobuf:"bytes,3,opt,name=Expr,json=expr" json:"Expr,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func SqlWhereToPb ¶
func SqlWhereToPb(m *SqlWhere) *SqlWherePb
func (*SqlWherePb) Descriptor ¶
func (*SqlWherePb) Descriptor() ([]byte, []int)
func (*SqlWherePb) GetExpr ¶
func (m *SqlWherePb) GetExpr() *expr.NodePb
func (*SqlWherePb) GetOp ¶
func (m *SqlWherePb) GetOp() int32
func (*SqlWherePb) GetSource ¶
func (m *SqlWherePb) GetSource() *SqlSelectPb
func (*SqlWherePb) Marshal ¶
func (m *SqlWherePb) Marshal() (data []byte, err error)
func (*SqlWherePb) ProtoMessage ¶
func (*SqlWherePb) ProtoMessage()
func (*SqlWherePb) Reset ¶
func (m *SqlWherePb) Reset()
func (*SqlWherePb) Size ¶
func (m *SqlWherePb) Size() (n int)
func (*SqlWherePb) String ¶
func (m *SqlWherePb) String() string
func (*SqlWherePb) Unmarshal ¶
func (m *SqlWherePb) Unmarshal(data []byte) error
type Sqlbridge ¶
type Sqlbridge struct {
*SqlTokenPager
// contains filtered or unexported fields
}
Sqlbridge generic SQL parser evaluates should be sufficient for most
sql compatible languages