Skip to content

Commit d1c40b0

Browse files
azizkprincemaple
authored andcommitted
SQL: recognize CREATE TYPE
1 parent 8a2cf34 commit d1c40b0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

syntaxes/SQL (Elixir).sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contexts:
2020
# Taken from https://www.postgresql.org/docs/current/sql-keywords-appendix.html
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
23-
| cast|cross|column|concurrently|collat(?:e|ion)|create|distinct|(?<!\bas\s)do
23+
| cast|cross|column|concurrently|collat(?:e|ion)|create|(?<=\bcreate\s)type|distinct|(?<!\bas\s)do
2424
| 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

tests/syntax_test_sql_fragments.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ fragment("t AT TIME ZONE")
191191
## ^^^^^^ keyword.other.DML.sql
192192
## ^^^^^^ -constant.other.table-name
193193

194+
sql("CREATE TYPE t AS ENUM")
195+
# ^ variable.other
196+
# ^^^^ keyword.other
197+
# ^ -keyword.other
198+
194199
sql("""
195200
SELECT * FROM "table" AS t WHERE t."f i e l d"
196201
# ^^^^^^^^^^^ string.quoted.double.sql

0 commit comments

Comments
 (0)