tree-sitter-sql 0.3.5__cp38-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ "Sql grammar for tree-sitter"
2
+
3
+ from ._binding import language
4
+
5
+ __all__ = ["language"]
@@ -0,0 +1 @@
1
+ def language() -> int: ...
Binary file
@@ -0,0 +1,27 @@
1
+ #include <Python.h>
2
+
3
+ typedef struct TSLanguage TSLanguage;
4
+
5
+ TSLanguage *tree_sitter_sql(void);
6
+
7
+ static PyObject* _binding_language(PyObject *self, PyObject *args) {
8
+ return PyLong_FromVoidPtr(tree_sitter_sql());
9
+ }
10
+
11
+ static PyMethodDef methods[] = {
12
+ {"language", _binding_language, METH_NOARGS,
13
+ "Get the tree-sitter language for this grammar."},
14
+ {NULL, NULL, 0, NULL}
15
+ };
16
+
17
+ static struct PyModuleDef module = {
18
+ .m_base = PyModuleDef_HEAD_INIT,
19
+ .m_name = "_binding",
20
+ .m_doc = NULL,
21
+ .m_size = -1,
22
+ .m_methods = methods
23
+ };
24
+
25
+ PyMODINIT_FUNC PyInit__binding(void) {
26
+ return PyModule_Create(&module);
27
+ }
File without changes
@@ -0,0 +1,447 @@
1
+ (object_reference
2
+ name: (identifier) @type)
3
+
4
+ (invocation
5
+ (object_reference
6
+ name: (identifier) @function.call))
7
+
8
+ [
9
+ (keyword_gist)
10
+ (keyword_btree)
11
+ (keyword_hash)
12
+ (keyword_spgist)
13
+ (keyword_gin)
14
+ (keyword_brin)
15
+ (keyword_array)
16
+ ] @function.call
17
+
18
+ (relation
19
+ alias: (identifier) @variable)
20
+
21
+ (field
22
+ name: (identifier) @field)
23
+
24
+ (term
25
+ alias: (identifier) @variable)
26
+
27
+ ((term
28
+ value: (cast
29
+ name: (keyword_cast) @function.call
30
+ parameter: [(literal)]?)))
31
+
32
+ (literal) @string
33
+ (comment) @comment @spell
34
+ (marginalia) @comment
35
+
36
+ ((literal) @number
37
+ (#match? @number "^[-+]?%d+$"))
38
+
39
+ ((literal) @float
40
+ (#match? @float "^[-+]?%d*\.%d*$"))
41
+
42
+ (parameter) @parameter
43
+
44
+ [
45
+ (keyword_true)
46
+ (keyword_false)
47
+ ] @boolean
48
+
49
+ [
50
+ (keyword_asc)
51
+ (keyword_desc)
52
+ (keyword_terminated)
53
+ (keyword_escaped)
54
+ (keyword_unsigned)
55
+ (keyword_nulls)
56
+ (keyword_last)
57
+ (keyword_delimited)
58
+ (keyword_replication)
59
+ (keyword_auto_increment)
60
+ (keyword_default)
61
+ (keyword_collate)
62
+ (keyword_concurrently)
63
+ (keyword_engine)
64
+ (keyword_always)
65
+ (keyword_generated)
66
+ (keyword_preceding)
67
+ (keyword_following)
68
+ (keyword_first)
69
+ (keyword_current_timestamp)
70
+ (keyword_immutable)
71
+ (keyword_atomic)
72
+ (keyword_parallel)
73
+ (keyword_leakproof)
74
+ (keyword_safe)
75
+ (keyword_cost)
76
+ (keyword_strict)
77
+ ] @attribute
78
+
79
+ [
80
+ (keyword_materialized)
81
+ (keyword_recursive)
82
+ (keyword_temp)
83
+ (keyword_temporary)
84
+ (keyword_unlogged)
85
+ (keyword_external)
86
+ (keyword_parquet)
87
+ (keyword_csv)
88
+ (keyword_rcfile)
89
+ (keyword_textfile)
90
+ (keyword_orc)
91
+ (keyword_avro)
92
+ (keyword_jsonfile)
93
+ (keyword_sequencefile)
94
+ (keyword_volatile)
95
+ ] @storageclass
96
+
97
+ [
98
+ (keyword_case)
99
+ (keyword_when)
100
+ (keyword_then)
101
+ (keyword_else)
102
+ ] @conditional
103
+
104
+ [
105
+ (keyword_select)
106
+ (keyword_from)
107
+ (keyword_where)
108
+ (keyword_index)
109
+ (keyword_join)
110
+ (keyword_primary)
111
+ (keyword_delete)
112
+ (keyword_create)
113
+ (keyword_insert)
114
+ (keyword_merge)
115
+ (keyword_distinct)
116
+ (keyword_replace)
117
+ (keyword_update)
118
+ (keyword_into)
119
+ (keyword_overwrite)
120
+ (keyword_matched)
121
+ (keyword_values)
122
+ (keyword_value)
123
+ (keyword_attribute)
124
+ (keyword_set)
125
+ (keyword_left)
126
+ (keyword_right)
127
+ (keyword_outer)
128
+ (keyword_inner)
129
+ (keyword_full)
130
+ (keyword_order)
131
+ (keyword_partition)
132
+ (keyword_group)
133
+ (keyword_with)
134
+ (keyword_without)
135
+ (keyword_as)
136
+ (keyword_having)
137
+ (keyword_limit)
138
+ (keyword_offset)
139
+ (keyword_table)
140
+ (keyword_tables)
141
+ (keyword_key)
142
+ (keyword_references)
143
+ (keyword_foreign)
144
+ (keyword_constraint)
145
+ (keyword_force)
146
+ (keyword_use)
147
+ (keyword_for)
148
+ (keyword_if)
149
+ (keyword_exists)
150
+ (keyword_max)
151
+ (keyword_min)
152
+ (keyword_avg)
153
+ (keyword_column)
154
+ (keyword_columns)
155
+ (keyword_cross)
156
+ (keyword_lateral)
157
+ (keyword_natural)
158
+ (keyword_alter)
159
+ (keyword_drop)
160
+ (keyword_add)
161
+ (keyword_view)
162
+ (keyword_end)
163
+ (keyword_is)
164
+ (keyword_using)
165
+ (keyword_between)
166
+ (keyword_window)
167
+ (keyword_no)
168
+ (keyword_data)
169
+ (keyword_type)
170
+ (keyword_rename)
171
+ (keyword_to)
172
+ (keyword_schema)
173
+ (keyword_owner)
174
+ (keyword_authorization)
175
+ (keyword_all)
176
+ (keyword_any)
177
+ (keyword_some)
178
+ (keyword_returning)
179
+ (keyword_begin)
180
+ (keyword_commit)
181
+ (keyword_rollback)
182
+ (keyword_transaction)
183
+ (keyword_only)
184
+ (keyword_like)
185
+ (keyword_similar)
186
+ (keyword_over)
187
+ (keyword_change)
188
+ (keyword_modify)
189
+ (keyword_after)
190
+ (keyword_before)
191
+ (keyword_range)
192
+ (keyword_rows)
193
+ (keyword_groups)
194
+ (keyword_exclude)
195
+ (keyword_current)
196
+ (keyword_ties)
197
+ (keyword_others)
198
+ (keyword_preserve)
199
+ (keyword_zerofill)
200
+ (keyword_format)
201
+ (keyword_fields)
202
+ (keyword_row)
203
+ (keyword_sort)
204
+ (keyword_compute)
205
+ (keyword_comment)
206
+ (keyword_location)
207
+ (keyword_cached)
208
+ (keyword_uncached)
209
+ (keyword_lines)
210
+ (keyword_stored)
211
+ (keyword_virtual)
212
+ (keyword_partitioned)
213
+ (keyword_analyze)
214
+ (keyword_explain)
215
+ (keyword_verbose)
216
+ (keyword_truncate)
217
+ (keyword_rewrite)
218
+ (keyword_optimize)
219
+ (keyword_vacuum)
220
+ (keyword_cache)
221
+ (keyword_language)
222
+ (keyword_sql)
223
+ (keyword_called)
224
+ (keyword_conflict)
225
+ (keyword_declare)
226
+ (keyword_filter)
227
+ (keyword_function)
228
+ (keyword_input)
229
+ (keyword_name)
230
+ (keyword_oid)
231
+ (keyword_oids)
232
+ (keyword_options)
233
+ (keyword_plpgsql)
234
+ (keyword_precision)
235
+ (keyword_regclass)
236
+ (keyword_regnamespace)
237
+ (keyword_regproc)
238
+ (keyword_regtype)
239
+ (keyword_restricted)
240
+ (keyword_return)
241
+ (keyword_returns)
242
+ (keyword_separator)
243
+ (keyword_setof)
244
+ (keyword_stable)
245
+ (keyword_support)
246
+ (keyword_tblproperties)
247
+ (keyword_trigger)
248
+ (keyword_unsafe)
249
+ (keyword_admin)
250
+ (keyword_connection)
251
+ (keyword_cycle)
252
+ (keyword_database)
253
+ (keyword_encrypted)
254
+ (keyword_increment)
255
+ (keyword_logged)
256
+ (keyword_none)
257
+ (keyword_owned)
258
+ (keyword_password)
259
+ (keyword_reset)
260
+ (keyword_role)
261
+ (keyword_sequence)
262
+ (keyword_start)
263
+ (keyword_restart)
264
+ (keyword_tablespace)
265
+ (keyword_until)
266
+ (keyword_user)
267
+ (keyword_valid)
268
+ (keyword_action)
269
+ (keyword_definer)
270
+ (keyword_invoker)
271
+ (keyword_security)
272
+ (keyword_extension)
273
+ (keyword_version)
274
+ (keyword_out)
275
+ (keyword_inout)
276
+ (keyword_variadic)
277
+ (keyword_session)
278
+ (keyword_isolation)
279
+ (keyword_level)
280
+ (keyword_serializable)
281
+ (keyword_repeatable)
282
+ (keyword_read)
283
+ (keyword_write)
284
+ (keyword_committed)
285
+ (keyword_uncommitted)
286
+ (keyword_deferrable)
287
+ (keyword_names)
288
+ (keyword_zone)
289
+ (keyword_immediate)
290
+ (keyword_deferred)
291
+ (keyword_constraints)
292
+ (keyword_snapshot)
293
+ (keyword_characteristics)
294
+ (keyword_off)
295
+ (keyword_follows)
296
+ (keyword_precedes)
297
+ (keyword_each)
298
+ (keyword_instead)
299
+ (keyword_of)
300
+ (keyword_initially)
301
+ (keyword_old)
302
+ (keyword_new)
303
+ (keyword_referencing)
304
+ (keyword_statement)
305
+ (keyword_execute)
306
+ (keyword_procedure)
307
+ (keyword_copy)
308
+ (keyword_delimiter)
309
+ (keyword_encoding)
310
+ (keyword_escape)
311
+ (keyword_force_not_null)
312
+ (keyword_force_null)
313
+ (keyword_force_quote)
314
+ (keyword_freeze)
315
+ (keyword_header)
316
+ (keyword_match)
317
+ (keyword_program)
318
+ (keyword_quote)
319
+ (keyword_stdin)
320
+ (keyword_extended)
321
+ (keyword_main)
322
+ (keyword_plain)
323
+ (keyword_storage)
324
+ (keyword_compression)
325
+ ] @keyword
326
+
327
+ [
328
+ (keyword_restrict)
329
+ (keyword_unbounded)
330
+ (keyword_unique)
331
+ (keyword_cascade)
332
+ (keyword_delayed)
333
+ (keyword_high_priority)
334
+ (keyword_low_priority)
335
+ (keyword_ignore)
336
+ (keyword_nothing)
337
+ (keyword_check)
338
+ (keyword_option)
339
+ (keyword_local)
340
+ (keyword_cascaded)
341
+ (keyword_wait)
342
+ (keyword_nowait)
343
+ (keyword_metadata)
344
+ (keyword_incremental)
345
+ (keyword_bin_pack)
346
+ (keyword_noscan)
347
+ (keyword_stats)
348
+ (keyword_statistics)
349
+ (keyword_maxvalue)
350
+ (keyword_minvalue)
351
+ ] @type.qualifier
352
+
353
+ [
354
+ (keyword_int)
355
+ (keyword_null)
356
+ (keyword_boolean)
357
+ (keyword_binary)
358
+ (keyword_varbinary)
359
+ (keyword_image)
360
+ (keyword_bit)
361
+ (keyword_inet)
362
+ (keyword_character)
363
+ (keyword_smallserial)
364
+ (keyword_serial)
365
+ (keyword_bigserial)
366
+ (keyword_smallint)
367
+ (keyword_mediumint)
368
+ (keyword_bigint)
369
+ (keyword_tinyint)
370
+ (keyword_decimal)
371
+ (keyword_float)
372
+ (keyword_double)
373
+ (keyword_numeric)
374
+ (keyword_real)
375
+ (double)
376
+ (keyword_money)
377
+ (keyword_smallmoney)
378
+ (keyword_char)
379
+ (keyword_nchar)
380
+ (keyword_varchar)
381
+ (keyword_nvarchar)
382
+ (keyword_varying)
383
+ (keyword_text)
384
+ (keyword_string)
385
+ (keyword_uuid)
386
+ (keyword_json)
387
+ (keyword_jsonb)
388
+ (keyword_xml)
389
+ (keyword_bytea)
390
+ (keyword_enum)
391
+ (keyword_date)
392
+ (keyword_datetime)
393
+ (keyword_time)
394
+ (keyword_datetime2)
395
+ (keyword_datetimeoffset)
396
+ (keyword_smalldatetime)
397
+ (keyword_timestamp)
398
+ (keyword_timestamptz)
399
+ (keyword_geometry)
400
+ (keyword_geography)
401
+ (keyword_box2d)
402
+ (keyword_box3d)
403
+ (keyword_interval)
404
+ ] @type.builtin
405
+
406
+ [
407
+ (keyword_in)
408
+ (keyword_and)
409
+ (keyword_or)
410
+ (keyword_not)
411
+ (keyword_by)
412
+ (keyword_on)
413
+ (keyword_do)
414
+ (keyword_union)
415
+ (keyword_except)
416
+ (keyword_intersect)
417
+ ] @keyword.operator
418
+
419
+ [
420
+ "+"
421
+ "-"
422
+ "*"
423
+ "/"
424
+ "%"
425
+ "^"
426
+ ":="
427
+ "="
428
+ "<"
429
+ "<="
430
+ "!="
431
+ ">="
432
+ ">"
433
+ "<>"
434
+ (op_other)
435
+ (op_unary_other)
436
+ ] @operator
437
+
438
+ [
439
+ "("
440
+ ")"
441
+ ] @punctuation.bracket
442
+
443
+ [
444
+ ";"
445
+ ","
446
+ "."
447
+ ] @punctuation.delimiter
@@ -0,0 +1,27 @@
1
+ [
2
+ (select)
3
+ (cte)
4
+ (column_definitions)
5
+ (case)
6
+ (subquery)
7
+ (insert)
8
+ ] @indent.begin
9
+
10
+
11
+ (block
12
+ (keyword_begin)
13
+ ) @indent.begin
14
+
15
+ (column_definitions ")" @indent.branch)
16
+
17
+ (subquery ")" @indent.branch)
18
+
19
+ (cte ")" @indent.branch)
20
+
21
+ [
22
+ (keyword_end)
23
+ (keyword_values)
24
+ (keyword_into)
25
+ ] @indent.branch
26
+
27
+ (keyword_end) @indent.end
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Derek Stride
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.1
2
+ Name: tree-sitter-sql
3
+ Version: 0.3.5
4
+ Summary: Sql grammar for tree-sitter
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-sql
7
+ Keywords: incremental,parsing,tree-sitter,sql
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Topic :: Software Development :: Compilers
11
+ Classifier: Topic :: Text Processing :: Linguistic
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Provides-Extra: core
17
+ Requires-Dist: tree-sitter~=0.21; extra == "core"
18
+
19
+ # tree-sitter-sql
20
+
21
+ [![Build/test](https://github.com/derekstride/tree-sitter-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/derekstride/tree-sitter-sql/actions/workflows/ci.yml)
22
+ [![GitHub Pages](https://github.com/DerekStride/tree-sitter-sql/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/DerekStride/tree-sitter-sql/actions/workflows/gh-pages.yml)
23
+ [![npm package version](https://img.shields.io/npm/v/%40derekstride/tree-sitter-sql?logo=npm&color=brightgreen)](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
24
+
25
+
26
+ A general/permissive SQL grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
27
+
28
+ ## Installation
29
+
30
+ **We don't commit the generated parser files to the `main` branch.** Instead, you can find them on the
31
+ [gh-pages](https://github.com/DerekStride/tree-sitter-sql/tree/gh-pages) branch. We're open to feedback & encourage you
32
+ to [open an issue](https://github.com/DerekStride/tree-sitter-sql/issues/new) to discuss any problems.
33
+
34
+ They are also hosted on the [GitHub pages site](https://derek.stride.host/tree-sitter-sql/) and available for download
35
+ here:
36
+ [github://derekstride/tree-sitter-sql/gh-pages.tar.gz](https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz).
37
+
38
+ *Plugin maintainers ensure to specify the `HEAD` (or a specific revision) of the `gh-pages` branch when integrating
39
+ with this project.*
40
+
41
+ ### Step 1: Download the parser files
42
+
43
+ **Using `git`**
44
+ ```bash
45
+ git clone https://github.com/DerekStride/tree-sitter-sql.git
46
+ cd tree-sitter-sql
47
+ git checkout gh-pages
48
+ ```
49
+
50
+ **Using `curl`**
51
+ ```bash
52
+ curl -LO https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz
53
+ tar -xzf gh-pages.tar.gz
54
+ cd tree-sitter-sql-gh-pages
55
+ ```
56
+
57
+ ### Step 2: Compile the Parser
58
+
59
+ Tree-sitter parsers need to be compiled as a shared-object / dynamic-library, you can enable this by passing the
60
+ `-shared` & `-fPIC` flags to your compiler.
61
+
62
+ ```bash
63
+ cc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so
64
+ ```
65
+
66
+ ### Using [Cargo](https://crates.io/crates/tree-sitter-sequel)
67
+
68
+ ```bash
69
+ cargo add tree-sitter-sequel
70
+ ```
71
+
72
+ ### Using [NPM](https://www.npmjs.com/package/@derekstride/tree-sitter-sql)
73
+
74
+ ```bash
75
+ npm i @derekstride/tree-sitter-sql
76
+ ```
77
+
78
+ ## Development
79
+
80
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for documentation on how to set up the project for development.
81
+
82
+ ## Features
83
+
84
+ For a complete list of features see the the [tests](test/corpus)
85
+
86
+ ## References
87
+
88
+ * [Wikipedia#SQL_syntax](https://en.wikipedia.org/wiki/SQL_syntax) - I consulted wikipedia for naming conventions,
89
+ though I may not have been strict early on in the prototyping.
90
+ * [Phoenix Language Reference](https://forcedotcom.github.io/phoenix/index.html) - A reference diagram.
91
+ * [SQLite's railroad diagram for expr](https://www.sqlite.org/lang_expr.html) - Another reference diagram.
92
+ * [Postgresql syntax documentation](https://www.postgresql.org/docs/current/sql-commands.html)
93
+ * [Mariadb syntax documentation](https://mariadb.com/kb/en/sql-statements-structure/)
94
+
95
+ ### Other projects
96
+
97
+ * https://github.com/m-novikov/tree-sitter-sql
98
+ * https://github.com/tjdevries/tree-sitter-sql
99
+ * https://github.com/dhcmrlchtdj/tree-sitter-sqlite
@@ -0,0 +1,12 @@
1
+ tree_sitter_sql/__init__.py,sha256=L4G4ilAICShRPyL_z5_XtR0Z2ISWeNpSJOzG08dbPqg,86
2
+ tree_sitter_sql/__init__.pyi,sha256=8xf7bY1szgDY9HRJ7FJ326So4SFgMiSRfCB4LADkTpU,27
3
+ tree_sitter_sql/_binding.pyd,sha256=w9gWmuBENn1ZYP4TTAvV_b_5IbGpelkppz1sanvVSEU,2033664
4
+ tree_sitter_sql/binding.c,sha256=axT1YQtIok7GzQXum8mV_A7HQQwWViiISLtPK0-_PEs,630
5
+ tree_sitter_sql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ tree_sitter_sql/queries/highlights.scm,sha256=7sY7drb-TPI8ce-R5aCajLEQJbrdjjTCwjEI2hl37_s,7797
7
+ tree_sitter_sql/queries/indents.scm,sha256=yQx5f_5szuWRLqssm4ZEug2wR37ZPL_voQxXRVI0izI,324
8
+ tree_sitter_sql-0.3.5.dist-info/LICENSE,sha256=Oz5OQlLV19HBjhJXAF8jJCvwWArWGSBP0JPJm4xWdI0,1069
9
+ tree_sitter_sql-0.3.5.dist-info/METADATA,sha256=ZCESO9EFTogcd3ZlvB7mf3lnFLNQ11lQwQrnTHna4ck,3898
10
+ tree_sitter_sql-0.3.5.dist-info/WHEEL,sha256=HyrewbdGRFSiCNDH2b5_R6gC8PlUKJwC5UbQxS7ZzNk,100
11
+ tree_sitter_sql-0.3.5.dist-info/top_level.txt,sha256=wrevlSYXZSDx7lr2DDOyfbxHZ9Ky0Nfw8tAc45dfcPE,25
12
+ tree_sitter_sql-0.3.5.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.44.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp38-abi3-win_amd64
5
+
@@ -0,0 +1,2 @@
1
+ _binding
2
+ tree_sitter_sql