diff --git a/grammars/README.md b/grammars/README.md index 5e761697c90b..ca63c1781c28 100644 --- a/grammars/README.md +++ b/grammars/README.md @@ -9,6 +9,7 @@ an index. - [Ace](https://ace.c9.io/) — supported. The grammar is upstream ([prql_highlight_rules.js](https://github.com/ajaxorg/ace/blob/master/src/mode/prql_highlight_rules.js)). + See the [demo](https://prql-lang.org/demos/ace-demo). - [Lezer](https://lezer.codemirror.net/) — used by CodeMirror editors. The PRQL file is at diff --git a/web/website/content/demos/ace-demo.html b/web/website/content/demos/ace-demo.html new file mode 100644 index 000000000000..0f7eb649c4f7 --- /dev/null +++ b/web/website/content/demos/ace-demo.html @@ -0,0 +1,48 @@ + + + +Ace with PRQL + + + + +
# https://ace.c9.io/ +from invoices +filter invoice_date >= @1970-01-16 +derive { + transaction_fees = 0.8, + income = total - transaction_fees +} +filter income > 1 +group customer_id ( + aggregate { + average total, + sum_income = sum income, + ct = count total, + } +) +sort {-sum_income} +take 10 +join c=customers (==customer_id) +derive name = f"{c.last_name}, {c.first_name}" +select { + c.customer_id, name, sum_income +} +derive db_version = s"version()"
+ + + + +