1.0.6 • Published 1 year ago
ayaya-lang-rewrite v1.0.6
Actions
TAKE - Limiter
TAKE generic
TAKE number
ON - Table selector
ON table_name
MATCH - Data filter
SHOW - Pick fields
SHOW generic
SHOW field
COUNT - Counting fields
COUNT
COUNT field
SORT - Sort results
SORT field
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