ayaya-lang-rewrite
v1.0.6
Published
TAKE [generic]
Downloads
3
Readme
Actions
TAKE - Limiter
TAKE [generic]
TAKE [number]
ON - Table selector
ON [table_name]
MATCH - Data filter
MATCH [field] [operator] [value]
SHOW - Pick fields
SHOW [generic]
SHOW [field]
SHOW [field1], [field2], [fieldN]
COUNT - Counting fields
COUNT
COUNT [field]
SORT - Sort results
SORT [field] [sort]
OPERATORS
=
, >
, <
, like
, and
, or
GENERIC
*
, all
, any
, every
NUMBER
single
, 1
, 2
, ...
SORT
asc
, des
Rules
Assume
TAKE *
if not presentAssume
SHOW *
if not presentCommand
ON
is requiredCommand
SHOW
andCOUNT
cannot be in the same queryCommand
SORT
andCOUNT
cannot be in the same query
Aggregation priority
supermatch
match
sort
limit
Examples
Description:
Get the age of the first 2 users named John
Query:
`TAKE 2 ON users MATCH name = 'John' SHOW 'age';`
Result:
`[ 24, 21 ]`
TODO:
- Write tests