Skip to content

Commit e653b75

Browse files
azizkprincemaple
authored andcommitted
SQL: recognize FILTER (...)
1 parent 6122ca0 commit e653b75

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

syntaxes/SQL (Elixir).sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ contexts:
2121
all|any|array|analy[sz]e|a?symmetric|authorization|at(?=\s+time\s+zone\b)|binary|both|by
2222
| (?<=\bat\s)time(?=\s+zone\b) | (?<=\btime\s)zone | (?<=\bdo\s)nothing | (?<=\bon\s)conflict | (?<=\bwith\s)ordinality
2323
| cast|cross|column|concurrently|collat(?:e|ion)|create|distinct|(?<!\bas\s)do
24-
| except|excluded(?=\s*\.)|fetch|for(?:eign)?|freeze|full|group|intersect|into|inner|isnull
24+
| except|excluded(?=\s*\.)|fetch|filter(?=\s+\()|for(?:eign)?|freeze|full|group|intersect|into|inner|isnull
2525
| i[sn]|ilike|lateral|leading|left|natural|not(?:null)?|nullif|on(?:ly)?|offset|order|outer
2626
| over(?:laps)?|primary|recursive|returning|right|similar|some|table(?:sample)?|to|trailing
2727
| unnest|unique|user|variadic|verbose|window

tests/syntax_test_sql.ex.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
-- ^ punctuation.accessor.dot
1919
-- ^^^^^ constant.other.table-name
2020

21+
SELECT array_agg(vote) FILTER (WHERE vote IS NOT NULL) FROM posts
22+
-- ^^^^^ variable.other
23+
-- ^^^^ keyword.other.DML
24+
-- ^^^^ constant.language.null
25+
-- ^^^ keyword.other
26+
-- ^^ keyword.other
27+
-- ^^^^ variable.other
28+
-- ^^^^^ keyword.other.DML
29+
-- ^^^^^^ keyword.other
30+
-- ^^^^ variable.other
31+
-- ^^^^^^^^^ variable.function
2132

2233
-- Numbers
2334

0 commit comments

Comments
 (0)