Documentation ¶
Index ¶
- type Const
- func (c Const) AsBool() bool
- func (c Const) AsFloat() float64
- func (c Const) AsInt() int64
- func (c Const) AsString() string
- func (c Const) CompareTo(c2 *Const) (int, error)
- func (c Const) Evaluate(r Record) (*Const, error)
- func (c Const) IsBool() bool
- func (c Const) IsNull() bool
- func (c Const) IsNumeric() bool
- func (c Const) IsString() bool
- func (c Const) String() string
- func (c Const) Value() interface{}
- type Field
- type Query
- func (q *Query) AddField(field *Field)
- func (q *Query) AddFields(fields []*Field)
- func (q *Query) Evaluate(record Record) (bool, error)
- func (q *Query) Fields() []*Field
- func (q *Query) FieldsValues(record Record) ([]*Const, error)
- func (q *Query) From() string
- func (q *Query) HasLimit() bool
- func (q *Query) Limit() int64
- func (q *Query) StartingAt() int64
- func (q *Query) String() string
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Const ¶
type Const struct {
// contains filtered or unexported fields
}
Const represents a Constant
func ConstFromString ¶
ConstFromString parses a Const from a string
func FloatConst ¶
FloatConst returns a new Const of type float
func StringConst ¶
StringConst returns a new Const of type String
func (Const) AsBool ¶
AsBool converts into a bool
- for bool, returns the value
- for null, returns false
- for numeric, returns true if not 0
- for strings, return true (test existence)
func (Const) CompareTo ¶
CompareTo returns:
- a positive integer if this Constant is greater than the given one
- a negative integer if this Constant is lower than the given one
- zero, is this constant is equals to the given one
If the comparison is not possible (incompatible types), an error will be returned
func (Const) Evaluate ¶
Evaluate evaluates a const against a record. In practice it always returns a pointer on itself
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field is a field, contained into the SELECT part and the condition. A field is an operand, it can return the value extracted into the Record.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a query
func QueryFromString ¶
QueryFromString creates a query from the given string
func (*Query) FieldsValues ¶
FieldsValues extracts the values of each fields into the given record Note that you should evaluate the query first
func (*Query) StartingAt ¶
StartingAt returns the 'STARTING AT' part of the query, or 0 if it's not present