on master help sign in
feat(sql): MariaDB/MySQL syntax, Apache Hive syntax, unified builtin functions, floats, negative integers (#6041)

* feat(sql): MariaDB/MySQL table options `COLLATE`, `CHARACTER SET`, `ENGINE` Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/286e10c5bc5d1703ee8f9afb351165a9a6182be1...30e15d45dceb24ea51acf81ee7d75d81567b6e02 * feat(sql): Optional `COLUMN` in `ALTER TABLE` Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/30e15d45dceb24ea51acf81ee7d75d81567b6e02...c508e6044adf4298d7b321f966c90cbe32d75d23 * feat(sql): Add `UNSIGNED` support, refactor numeric types Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/c508e6044adf4298d7b321f966c90cbe32d75d23...2d1d5b68a1e11796dd0f4f068fc3e9d7e59fe9f7 * feat(sql): Add support for Apache Spark create Hive table Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/2d1d5b68a1e11796dd0f4f068fc3e9d7e59fe9f7...7be06f4d5eabace883dd45959c13dc740f1f1b98 * feat(sql): Add support for signed and unsigned floating point literals Upstream changes: https://github.com/DerekStride/tree-sitter-sql/pull/92/files * feat(sql): Add interval data type Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/13d375dea377bae5f235176fae97a50ba584db54...7b4bcd0394d759a660f470a4f07aa08b7b130d8c * feat(sql): Add support for DROP INDEX Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/7b4bcd0394d759a660f470a4f07aa08b7b130d8c...173d6feb5064defb7d0ef742a4fc7c6d763a2df0 * feat(sql): Add MariaDB/MySQL `ALTER TABLE ... CHANGE|MODIFY ... [FIRST|AFTER]` syntax Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/173d6feb5064defb7d0ef742a4fc7c6d763a2df0...0d7a121b2a08fb37109f7be1cc6654443cad661f * feat(sql): Extract fields from Apache Hive storage location and row format Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/0d7a121b2a08fb37109f7be1cc6654443cad661f...d2f0f6695fffa4ec1c81fc2060eddf83161f9ee3 * feat(sql): Fix unified built-in functions Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/d2f0f6695fffa4ec1c81fc2060eddf83161f9ee3...e4e43ba742a2ee88cbb24dbf305a7daadd583873 * feat(sql): Support negative integers Upstream changes: https://github.com/DerekStride/tree-sitter-sql/compare/e4e43ba742a2ee88cbb24dbf305a7daadd583873...3a3f92b29c880488a08bc2baaf1aca6432ec3380 * rework(sql): Improve `@constant.numeric` regex

commit6494fc1daf2bb379e6a1f4ec94f3dafd99b3fb34 authorLeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> dateThu 23 Feb 2023, 01:04 (4 years ago) parent8043959
2 files changed+58−19
languages.toml+1−1 runtime/queries/sql/highlights.scm+57−18
languages.toml+1−1
@@ -1434,7 +1434,7 @@ injection-regex = "sql"
14341434
14351435[[grammar]]
14361436name = "sql"
1437−source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "286e10c5bc5d1703ee8f9afb351165a9a6182be1" }
1437+source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "3a3f92b29c880488a08bc2baaf1aca6432ec3380" }
14381438
14391439[[language]]
14401440name = "gdscript"
runtime/queries/sql/highlights.scm+57−18
@@ -1,20 +1,17 @@
1−(keyword_btree) @function.builtin
2−(keyword_hash) @function.builtin
3−(keyword_gist) @function.builtin
4−(keyword_spgist) @function.builtin
5−(keyword_gin) @function.builtin
6−(keyword_brin) @function.builtin
7−
8−(cast
9− name: (identifier) @function.builtin)
10−
11−(count
12− name: (identifier) @function.builtin)
131
14−(keyword_group_concat) @function.builtin
2+[
3+ (keyword_btree)
4+ (keyword_hash)
5+ (keyword_gist)
6+ (keyword_spgist)
7+ (keyword_gin)
8+ (keyword_brin)
159
16−(invocation
17− name: (identifier) @function.builtin)
10+ (cast)
11+ (count)
12+ (group_concat)
13+ (invocation)
14+] @function.builtin
1815
1916(table_reference
2017 name: (identifier) @namespace)
@@ -57,7 +54,7 @@
5754] @constant.builtin
5855
5956((literal) @constant.numeric
60− (#match? @constant.numeric "^(-?\d*\.?\d*)$"))
57+ (#match? @constant.numeric "^-?\\d*\\.?\\d*$"))
6158
6259(literal) @string
6360
@@ -92,6 +89,8 @@
9289 (keyword_primary)
9390 (keyword_create)
9491 (keyword_alter)
92+ (keyword_change)
93+ (keyword_modify)
9594 (keyword_drop)
9695 (keyword_add)
9796 (keyword_table)
@@ -119,8 +118,12 @@
119118 (keyword_if)
120119 (keyword_exists)
121120 (keyword_auto_increment)
121+ (keyword_collate)
122+ (keyword_character)
123+ (keyword_engine)
122124 (keyword_default)
123125 (keyword_cascade)
126+ (keyword_restrict)
124127 (keyword_with)
125128 (keyword_no)
126129 (keyword_data)
@@ -144,6 +147,7 @@
144147 (keyword_over)
145148 (keyword_nulls)
146149 (keyword_first)
150+ (keyword_after)
147151 (keyword_last)
148152 (keyword_window)
149153 (keyword_range)
@@ -170,6 +174,37 @@
170174 (keyword_like)
171175 (keyword_similar)
172176 (keyword_preserve)
177+ (keyword_unsigned)
178+ (keyword_zerofill)
179+
180+ (keyword_external)
181+ (keyword_stored)
182+ (keyword_cached)
183+ (keyword_uncached)
184+ (keyword_replication)
185+ (keyword_tblproperties)
186+ (keyword_compute)
187+ (keyword_stats)
188+ (keyword_location)
189+ (keyword_partitioned)
190+ (keyword_comment)
191+ (keyword_sort)
192+ (keyword_format)
193+ (keyword_delimited)
194+ (keyword_fields)
195+ (keyword_terminated)
196+ (keyword_escaped)
197+ (keyword_lines)
198+
199+ (keyword_parquet)
200+ (keyword_rcfile)
201+ (keyword_csv)
202+ (keyword_textfile)
203+ (keyword_avro)
204+ (keyword_sequencefile)
205+ (keyword_orc)
206+ (keyword_avro)
207+ (keyword_jsonfile)
173208] @keyword
174209
175210[
@@ -193,9 +228,11 @@
193228 (keyword_smallserial)
194229 (keyword_serial)
195230 (keyword_bigserial)
196− (keyword_smallint)
197− (keyword_int)
198231
232+ (tinyint)
233+ (smallint)
234+ (mediumint)
235+ (int)
199236 (bigint)
200237 (decimal)
201238 (numeric)
@@ -222,6 +259,8 @@
222259 (keyword_timestamp)
223260 (keyword_timestamptz)
224261
262+ (keyword_interval)
263+
225264 (keyword_geometry)
226265 (keyword_geography)
227266 (keyword_box2d)