Documentation
¶
Index ¶
- Constants
- func EvalQuery(query *Query, stmts []*pb.Statement) ([]interface{}, error)
- func StatementRefs(stmt *pb.Statement) []string
- func StatementSource(stmt *pb.Statement) string
- type CompoundCriteria
- type CompoundCriteriaFilter
- type CompoundResultSet
- type CompoundSelector
- type ConsCell
- type FunctionResultSet
- type FunctionSelector
- type FunctionStatementSelector
- type IndexCriteria
- type IndexCriteriaFilterSelect
- type MakeSimpleRowSelector
- type NegatedCriteria
- type ParseState
- type Query
- type QueryCompileError
- type QueryCriteria
- type QueryEvalError
- type QueryOrder
- type QueryOrderSpec
- type QueryParser
- func (t *QueryParser) AST() *node32
- func (t *QueryParser) Add(rule pegRule, begin, end, depth uint32, index int)
- func (t *QueryParser) Error() []token32
- func (p *QueryParser) Execute()
- func (t *QueryParser) Expand(index int)
- func (p *QueryParser) Highlighter()
- func (p *QueryParser) Init()
- func (t *QueryParser) Order() [][]token32
- func (t *QueryParser) PreOrder() (<-chan state32, [][]token32)
- func (t *QueryParser) Print()
- func (t *QueryParser) PrintSyntax()
- func (p *QueryParser) PrintSyntaxTree()
- func (t *QueryParser) Tokens() <-chan token32
- type QueryResultSet
- type QuerySelector
- type RangeCriteria
- type RangeCriteriaFilterCompare
- type RangeCriteriaFilterSelect
- type RowScanner
- type RowSelectBody
- type RowSelectCompound
- type RowSelectInt
- type RowSelectInt64
- type RowSelectNullInt64
- type RowSelectStatement
- type RowSelectString
- type RowSelector
- type SimpleResultSet
- type SimpleRowSelector
- type SimpleSelector
- type StatementFilter
- type StatementSelector
- type ValueCriteria
- type ValueCriteriaFilterCompare
- type ValueCriteriaFilterSelect
Constants ¶
View Source
const ( OpSelect = iota OpDelete )
Variables ¶
This section is empty.
Functions ¶
func EvalQuery ¶
query evaluation: very primitive eval with only simple statements will have to do until we have an index and we can compile to sql.
func StatementRefs ¶
func StatementSource ¶
Types ¶
type CompoundCriteria ¶
type CompoundCriteria struct {
// contains filtered or unexported fields
}
type CompoundCriteriaFilter ¶
type CompoundCriteriaFilter func(stmt *pb.Statement, left, right StatementFilter) bool
type CompoundResultSet ¶
type CompoundResultSet struct {
// contains filtered or unexported fields
}
type CompoundSelector ¶
type CompoundSelector []SimpleSelector
type FunctionResultSet ¶
type FunctionResultSet struct {
// contains filtered or unexported fields
}
type FunctionSelector ¶
type FunctionSelector struct {
// contains filtered or unexported fields
}
type FunctionStatementSelector ¶
type FunctionStatementSelector func([]interface{}) []interface{}
type IndexCriteria ¶
type IndexCriteria struct {
// contains filtered or unexported fields
}
type MakeSimpleRowSelector ¶
type MakeSimpleRowSelector func() SimpleRowSelector
type NegatedCriteria ¶
type NegatedCriteria struct {
// contains filtered or unexported fields
}
type ParseState ¶
type ParseState struct {
// contains filtered or unexported fields
}
type Query ¶
type Query struct {
Op int
// contains filtered or unexported fields
}
func (*Query) IsSimpleSelect ¶
func (*Query) WithSimpleSelect ¶
type QueryCompileError ¶
type QueryCompileError string
func (QueryCompileError) Error ¶
func (e QueryCompileError) Error() string
type QueryCriteria ¶
type QueryCriteria interface {
// contains filtered or unexported methods
}
type QueryEvalError ¶
type QueryEvalError string
func (QueryEvalError) Error ¶
func (e QueryEvalError) Error() string
type QueryOrder ¶
type QueryOrder []*QueryOrderSpec
type QueryOrderSpec ¶
type QueryOrderSpec struct {
// contains filtered or unexported fields
}
type QueryParser ¶
type QueryParser struct {
*ParseState
Buffer string
Parse func(rule ...int) error
Reset func()
Pretty bool
// contains filtered or unexported fields
}
func (*QueryParser) Execute ¶
func (p *QueryParser) Execute()
func (*QueryParser) Highlighter ¶
func (p *QueryParser) Highlighter()
func (*QueryParser) Init ¶
func (p *QueryParser) Init()
func (*QueryParser) PrintSyntax ¶
func (t *QueryParser) PrintSyntax()
func (*QueryParser) PrintSyntaxTree ¶
func (p *QueryParser) PrintSyntaxTree()
type QueryResultSet ¶
type QueryResultSet interface {
// contains filtered or unexported methods
}
type QuerySelector ¶
type QuerySelector interface {
// contains filtered or unexported methods
}
type RangeCriteria ¶
type RangeCriteria struct {
// contains filtered or unexported fields
}
type RowScanner ¶
type RowScanner interface {
Scan(res ...interface{}) error
}
Common Scan interface between sql.Row and sql.Rows
type RowSelectBody ¶
type RowSelectBody struct {
RowSelectStatement
}
func (*RowSelectBody) Scan ¶
func (rs *RowSelectBody) Scan(src RowScanner) (interface{}, error)
type RowSelectCompound ¶
type RowSelectCompound struct {
// contains filtered or unexported fields
}
func (*RowSelectCompound) Scan ¶
func (rs *RowSelectCompound) Scan(src RowScanner) (interface{}, error)
type RowSelectInt ¶
type RowSelectInt struct {
// contains filtered or unexported fields
}
func (*RowSelectInt) Scan ¶
func (rs *RowSelectInt) Scan(src RowScanner) (interface{}, error)
type RowSelectInt64 ¶
type RowSelectInt64 struct {
// contains filtered or unexported fields
}
func (*RowSelectInt64) Scan ¶
func (rs *RowSelectInt64) Scan(src RowScanner) (interface{}, error)
type RowSelectNullInt64 ¶
type RowSelectNullInt64 struct {
// contains filtered or unexported fields
}
func (*RowSelectNullInt64) Scan ¶
func (rs *RowSelectNullInt64) Scan(src RowScanner) (interface{}, error)
type RowSelectStatement ¶
type RowSelectStatement struct {
// contains filtered or unexported fields
}
func (*RowSelectStatement) Scan ¶
func (rs *RowSelectStatement) Scan(src RowScanner) (interface{}, error)
type RowSelectString ¶
type RowSelectString struct {
// contains filtered or unexported fields
}
func (*RowSelectString) Scan ¶
func (rs *RowSelectString) Scan(src RowScanner) (interface{}, error)
type RowSelector ¶
type RowSelector interface {
Scan(src RowScanner) (interface{}, error)
}
A RowSelector extracts the next value from an sql result set
func CompileQuery ¶
func CompileQuery(q *Query) (string, RowSelector, error)
CompileQuery compiles a query to sql. Returns the compiled sql query and a selector for extracting values from an sql result set Note: The row selector should be used in single-threaded context
type SimpleResultSet ¶
type SimpleResultSet struct {
// contains filtered or unexported fields
}
type SimpleRowSelector ¶
type SimpleRowSelector interface {
RowSelector
// contains filtered or unexported methods
}
type SimpleSelector ¶
type SimpleSelector string
type StatementFilter ¶
type StatementSelector ¶
type ValueCriteria ¶
type ValueCriteria struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.