Documentation ¶
Overview ¶
Package pql defines the Pilosa Query Language.
Index ¶
- func CopyArgs(m map[string]interface{}) map[string]interface{}
- func IsReservedArg(name string) bool
- 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 ¶
func IsReservedArg ¶ added in v1.3.0
Types ¶
type Call ¶
Call represents a function call in the AST.
func (*Call) BoolArg ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.0.0
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 ¶ added in v0.7.0
HasConditionArg returns true if any arg is a conditional.
func (*Call) IntArg ¶ added in v1.0.0
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 ¶ added in v0.7.0
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 ¶ added in v0.7.0
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 ¶ added in v1.0.0
func (*PQL) PrettyPrintSyntaxTree ¶ added in v1.0.0
func (t *PQL) PrettyPrintSyntaxTree(buffer string)
func (*PQL) PrintSyntaxTree ¶ added in v1.0.0
func (p *PQL) PrintSyntaxTree()
type Query ¶
type Query struct { Calls []*Call // contains filtered or unexported fields }
Query represents a PQL query.
func (*Query) WriteCallN ¶ added in v0.4.0
WriteCallN returns the number of mutating calls.