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

1.0.4 • Public • Published

Actions

MORE of sql

Limit - Limiter

limit [generic]

limit [number]

FROM - Table selector

FROM [table_name]

WHERE - Data filter

WHERE [field] [operator] [value]

SELECT fields

SELECT [generic]

SELECT [field]

SELECT [field1, field2, fieldN]

COUNT - Counting fields

COUNT Generic

COUNT [field]

Order - Sort results

ORDER [field] [sort]

OPERATORS

=, >, <, like, and, or

GENERIC

*, all, any, every

NUMBER

single, 1, 2, ...

SORT

asc, des

Rules

  • Assume Limit * if not present

  • Assume SELECT * if not present

  • Command FROM is required

  • Command SELECT and COUNT cannot be in the same query

  • Command ORDER 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:

`LIMIT 2 FROM users WHERE name = 'John' SELECT 'age';`

Result:

`[ 24, 21 ]`

TODO:

  • Write tests

Readme

Keywords

none

Package Sidebar

Install

npm i ayaya-lang-rewrite-v2

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

75.7 kB

Total Files

68

Last publish

Collaborators

  • kipmurkor