Documentation ¶
Overview ¶
Package pql defines the Pilosa Query Language.
Index ¶
- func CopyArgs(m map[string]interface{}) map[string]interface{}
- func NewParser(r io.Reader) *parser
- type Call
- func (c *Call) BoolArg(key string) (bool, bool, error)
- func (c *Call) CallArg(key string) (*Call, bool, error)
- func (c *Call) Clone() *Call
- func (c *Call) FieldArg() (string, error)
- func (c *Call) HasConditionArg() bool
- func (c *Call) IntArg(key string) (int64, bool, error)
- func (c *Call) String() string
- func (c *Call) UintArg(key string) (uint64, bool, error)
- func (c *Call) UintSliceArg(key string) ([]uint64, bool, error)
- type Condition
- type PQL
- func (t *PQL) AST() *node32
- func (t *PQL) Add(rule pegRule, begin, end, index uint32)
- func (p *PQL) Execute()
- func (p *PQL) Init()
- func (p *PQL) Parse(rule ...int) error
- func (t *PQL) PrettyPrintSyntaxTree(buffer string)
- func (t *PQL) Print()
- func (p *PQL) PrintSyntaxTree()
- func (p *PQL) Reset()
- func (t *PQL) Tokens() []token32
- func (t *PQL) Trim(length uint32)
- type Query
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Call ¶
Call represents a function call in the AST.
func (*Call) BoolArg ¶
BoolArg is for reading the value at key from call.Args as a bool. If the key is not in Call.Args, the value of the returned bool will be false, and the error will be nil. The value is assumed to be a bool. An error is returned if the value is not a bool.
func (*Call) CallArg ¶
CallArg is for reading the value at key from call.Args as a Call. If the key is not in Call.Args, the value of the returned value will be nil, and the error will be nil. An error is returned if the value is not a Call.
func (*Call) FieldArg ¶
FieldArg determines which key-value pair contains the field and rowID, in the case of arguments like Set(colID, field=rowID). Returns the field as a string if present, or an error if not.
func (*Call) HasConditionArg ¶
HasConditionArg returns true if any arg is a conditional.
func (*Call) IntArg ¶
IntArg is for reading the value at key from call.Args as an int64. If the key is not in Call.Args, the value of the returned bool will be false, and the error will be nil. The value is assumed to be a unt64 or an int64 and then cast to an int64. An error is returned if the value is not an int64 or uint64.
func (*Call) UintArg ¶
UintArg is for reading the value at key from call.Args as a uint64. If the key is not in Call.Args, the value of the returned bool will be false, and the error will be nil. The value is assumed to be a uint64 or an int64 and then cast to a uint64. An error is returned if the value is not an int64 or uint64.
func (*Call) UintSliceArg ¶
UintSliceArg reads the value at key from call.Args as a slice of uint64. If the key is not in Call.Args, the value of the returned bool will be false, and the error will be nil. If the value is a slice of int64 it will convert it to []uint64. Otherwise, if it is not a []uint64 it will return an error.
type Condition ¶
type Condition struct { Op Token Value interface{} }
Condition represents an operation & value. When used in an argument map it represents a binary expression.
func (*Condition) IntSliceValue ¶
IntSliceValue reads cond.Value as a slice of uint64. If the value is a slice of uint64 it will convert it to []int64. Otherwise, if it is not a []int64 it will return an error.
type PQL ¶
func (*PQL) PrettyPrintSyntaxTree ¶
func (t *PQL) PrettyPrintSyntaxTree(buffer string)
func (*PQL) PrintSyntaxTree ¶
func (p *PQL) PrintSyntaxTree()
type Query ¶
type Query struct { Calls []*Call // contains filtered or unexported fields }
Query represents a PQL query.
func (*Query) WriteCallN ¶
WriteCallN returns the number of mutating calls.