Documentation ¶
Overview ¶
Package pql defines the Pilosa Query Language.
Index ¶
- Constants
- func CopyArgs(m map[string]interface{}) map[string]interface{}
- func FormatValue(v interface{}) string
- type Call
- func (c *Call) Clone() *Call
- func (c *Call) HasConditionArg() bool
- func (c *Call) IsInverse(rowLabel, columnLabel string) bool
- func (c *Call) Keys() []string
- func (c *Call) String() string
- func (c *Call) SupportsInverse() bool
- func (c *Call) UintArg(key string) (uint64, bool, error)
- func (c *Call) UintSliceArg(key string) ([]uint64, bool, error)
- type Condition
- type ParseError
- type Parser
- type Pos
- type Query
- type Scanner
- type Token
Constants ¶
const TimeFormat = "2006-01-02T15:04"
TimeFormat is the go-style time format used to parse string dates.
Variables ¶
This section is empty.
Functions ¶
func FormatValue ¶ added in v0.7.0
func FormatValue(v interface{}) string
Types ¶
type Call ¶
Call represents a function call in the AST.
func (*Call) HasConditionArg ¶ added in v0.7.0
HasConditionArg returns true if any arg is a conditional.
func (*Call) IsInverse ¶
IsInverse specifies if the call is for an inverse view. Return defaults to false unless absolutely sure of inversion.
func (*Call) SupportsInverse ¶
SupportsInverse indicates that the call may be on an inverse frame.
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 ParseError ¶
ParseError represents an error that occurred while parsing a PQL query.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
Error returns a string representation of e.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents a parser for the PQL language.
type Pos ¶
Pos specifies the line and character position of a token. The Char and Line are both zero-based indexes.
type Query ¶
type Query struct {
Calls []*Call
}
Query represents a PQL query.
func (*Query) WriteCallN ¶ added in v0.4.0
WriteCallN returns the number of mutating calls.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner represents a PQL lexical scanner.
func NewScanner ¶
NewScanner returns a new instance of Scanner.
type Token ¶
type Token int
Token is a lexical token of the PQL language.
const ( // Special tokens ILLEGAL Token = iota EOF WS IDENT // main STRING // "foo" BADSTRING // bad escape or unclosed string INTEGER // 12345 FLOAT // 100.2 ALL ASSIGN // = EQ // == NEQ // != LT // < LTE // <= GT // > GTE // >= BETWEEN // >< COMMA // , LPAREN // ( RPAREN // ) LBRACK // ( RBRACK // ) )