ayaya-lang-rewrite
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

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 present

  • Assume SHOW * if not present

  • Command ON is required

  • Command SHOW and COUNT cannot be in the same query

  • Command SORT and COUNT cannot be in the same query

Aggregation priority

  1. supermatch

  2. match

  3. sort

  4. 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

Readme

Keywords

none

Package Sidebar

Install

npm i ayaya-lang-rewrite

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

64.7 kB

Total Files

59

Last publish

Collaborators

  • botkalista