Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 352ff1a

Browse files
committed
Allow more than 2 ordering expressions. Closes #13
Thank you @gertheber
1 parent e8074d0 commit 352ff1a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ All notable changes to this project will be documented in this file.
1616
from nums n
1717
where num between 100 AND 200;
1818
```
19+
- Fixed `ORDER BY` grammar to allow more than two ordering expressions.
20+
21+
``` sql
22+
select color, size, shape, name
23+
from eggs
24+
order by color asc, size desc, shape asc
25+
```
1926

2027
## [v0.12.2] - 2016-01-29
2128
### Fixed

lib/parser.js

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/grammar.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ select_parts_values "VALUES Clause"
12491249
}
12501250

12511251
stmt_core_order_list
1252-
= f:( stmt_core_order_list_item ) o b:( stmt_core_order_list_loop )?
1252+
= f:( stmt_core_order_list_item ) o b:( stmt_core_order_list_loop )*
12531253
{
12541254
return {
12551255
'result': util.listify(f, b)

0 commit comments

Comments
 (0)