1.0.4 • Published 1 year ago
ayaya-lang-rewrite-v2 v1.0.4
Actions
MORE of sql
Limit - Limiter
limit generic
limit number
FROM - Table selector
FROM table_name
WHERE - Data filter
SELECT fields
SELECT generic
SELECT field
SELECT field1, field2, fieldN
COUNT - Counting fields
COUNT Generic
COUNT field
Order - Sort results
ORDER field
OPERATORS
=
, >
, <
, like
, and
, or
GENERIC
*
, all
, any
, every
NUMBER
single
, 1
, 2
, ...
SORT
asc
, des
Rules
Assume
Limit *
if not presentAssume
SELECT *
if not presentCommand
FROM
is requiredCommand
SELECT
andCOUNT
cannot be in the same queryCommand
ORDER
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:
`LIMIT 2 FROM users WHERE name = 'John' SELECT 'age';`
Result:
`[ 24, 21 ]`
TODO:
- Write tests