Download the PHP package graviton/rql-parser without Composer
On this page you can find all versions of the php package graviton/rql-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rql-parser
RQL parser
This is a RQL parsing library written in PHP.
This library consists of the following parts:
- lexer for tokenization RQL code
- parser for creating abstract syntax tree
Installation
The preferred way to install library is through composer.
Either run
or add
to the require section of your composer.json.
Basic usage
See also rql-command library. This is a console application to debug RQL lexing and parsing.
Advanced usage
See examples:
- Enable only FIQL operators
- Add new query operators
- Add support for aggregate functions
- Convert RQL to SQL
- Add date support
- Use scalars in array nodes
- Add
timestampcaster - Wrap strings with quotes
Current state
Operators
Basic syntax
- scalar operators
eq(a,b)ne(a,b)lt(a,b)gt(a,b)le(a,b)ge(a,b)
- array operators
in(a,(b,c))out(a,(b,c))
- logic operators
and(eq(a,b),ne(c,d))or(eq(a,b),ne(c,d))not(eq(a,b))
Short logic syntax
(eq(a,b)&ne(b,c))(eq(a,b)|ne(b,c))
FIQL syntax
- scalar operators
a=eq=ba=ne=ba=lt=ba=gt=ba=le=ba=ge=b
- array operators
a=in=(b,c)a=out=(b,c)
Simplified FIQL syntax
a=ba==ba<>ba!=ba<ba>ba<=ba>=b
Other
select(a,b,c)sort(+a,-b)limit(1,2)
All syntax variations may be used together.
Value types
- string
abcabc%20def
- integer
1,+1,-1
- float
1.,+1.,-1.0.1,+0.1,-0.1,0.1e5,+0.1e+5,-0.1e-5.1,+.1,-.1.1e5,+.1e+5,-.1e-5
- boolean
true()false()
- null
null()
- empty
empty()
- date
2015-06-02T20:00:00Z
- glob
abc*?abcabc*def?
Type casting
string:1boolean:0integer:afloat:1
Encoding rules
String values
In string values all non-alphanumeric characters must be encoded with a percent (%) sign followed by two hex digits.
Examples:
String encoding in PHP:
String encoding in JavaScript:
Other values
Date, number and const-function values must not be encoded.
Examples: