Tree-sitter Grammar for SQL
Project description
tree-sitter-sql
A general/permissive SQL grammar for tree-sitter.
Installation
We don't commit the generated parser files to the main branch. Instead, you can find them on the
gh-pages branch. We're open to feedback & encourage you
to open an issue to discuss any problems.
They are also hosted on the GitHub pages site and available for download here: github://derekstride/tree-sitter-sql/gh-pages.tar.gz.
Plugin maintainers ensure to specify the HEAD (or a specific revision) of the gh-pages branch when integrating
with this project.
Step 1: Download the parser files
Using git
git clone https://github.com/DerekStride/tree-sitter-sql.git
cd tree-sitter-sql
git checkout gh-pages
Using curl
curl -LO https://github.com/DerekStride/tree-sitter-sql/archive/refs/heads/gh-pages.tar.gz
tar -xzf gh-pages.tar.gz
cd tree-sitter-sql-gh-pages
Step 2: Compile the Parser
Tree-sitter parsers need to be compiled as a shared-object / dynamic-library, you can enable this by passing the
-shared & -fPIC flags to your compiler.
cc -shared -fPIC -I./src src/parser.c src/scanner.c -o sql.so
Using cargo
cargo add tree-sitter-sequel
Using npm
npm i @derekstride/tree-sitter-sql
Using pip
pip install tree-sitter-sql
Development
See CONTRIBUTING.md for documentation on how to set up the project for development.
Features
For a complete list of features see the the tests
References
- Wikipedia#SQL_syntax - I consulted wikipedia for naming conventions, though I may not have been strict early on in the prototyping.
- Phoenix Language Reference - A reference diagram.
- SQLite's railroad diagram for expr - Another reference diagram.
- Postgresql syntax documentation
- Mariadb syntax documentation
Other projects
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tree_sitter_sql-0.3.10.tar.gz.
File metadata
- Download URL: tree_sitter_sql-0.3.10.tar.gz
- Upload date:
- Size: 834.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d072fd4cc36cd7958b57ad9359713ec58f1fc566167d694fb9b3c9a758742253
|
|
| MD5 |
0e8a9607b9715a93c80ce9674c9138ec
|
|
| BLAKE2b-256 |
18fc3470ba7b76bbc89bd2eef0b8cf6f6717bad643fc5a5cc542741f7824ca24
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-win_arm64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-win_arm64.whl
- Upload date:
- Size: 333.5 kB
- Tags: CPython 3.10+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8add1bec17d027db8d9cac0cc065c9add07b04945cbbd0fce94281048aa2eb99
|
|
| MD5 |
e019e4c07dbd63569f6f758ea0a6d217
|
|
| BLAKE2b-256 |
c6efd0cba2eb331e13bb4ec58ab87689ef1d38f975b628843030e35b7ad981c1
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 343.6 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afef38760820169c7892306e57f875b4ff2984590db4f52289ce8f8e52f39d56
|
|
| MD5 |
ba0f330ff03a2ce6148e0a8ec13c7143
|
|
| BLAKE2b-256 |
9ae5118a709b2a5110c24d54198ff9342d2e1f34ea03677409a7201f2ad23d51
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 379.4 kB
- Tags: CPython 3.10+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b27e76a10a72276e01a75a2aee1713f1f84e9fb85dba752f04742c7ffe030ff0
|
|
| MD5 |
f0878ad485db8d961795905a07c3e5a9
|
|
| BLAKE2b-256 |
c3b9672a34484e222c6602368c80f45b5059cf79f0c006eb80fb99df0750fdcd
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 380.9 kB
- Tags: CPython 3.10+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e32a685d625846cf862855edfbf38349dd0e4f31ddb78e452354afc048803170
|
|
| MD5 |
bea11f6216721ce462f05c37bdd719c1
|
|
| BLAKE2b-256 |
776bdac4e7377cd5baa1ac5922deb9277dd1aece475d9e2faeb40ca7feba45fd
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 380.6 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f6582c7d91bbd20a8914cc3c5549c2c64e7e90125da1e0c0a82a7ce54cba9e2
|
|
| MD5 |
0fe24ef11e31b8e4a167322e332eb4fe
|
|
| BLAKE2b-256 |
47e05dd272e98f657b705c0c7f53d2b3ab27b5234342871f11b335428506ea12
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 381.2 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fa837dc99a40cc02aa7cf65c1bc0d1abfe1a36d1e764ba938374b89d427d120
|
|
| MD5 |
50c0722564fcee2e702e5975bb1981c6
|
|
| BLAKE2b-256 |
65bb449d8e8afc21104f8bec4713311decc44832f48ecd1e02434c22aaf07da0
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 341.6 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec43cb2eb82bb7a040281bda3c261295ddfc985b767026c72f767e910cbefb2a
|
|
| MD5 |
913908e1708f76ebc4b2a61f76375ad2
|
|
| BLAKE2b-256 |
d5666d187ea20da69368e472b4c16c30a00c7a0896a8a9956d3e81c8e120c779
|
File details
Details for the file tree_sitter_sql-0.3.10-cp310-abi3-macosx_10_9_x86_64.whl.
File metadata
- Download URL: tree_sitter_sql-0.3.10-cp310-abi3-macosx_10_9_x86_64.whl
- Upload date:
- Size: 322.0 kB
- Tags: CPython 3.10+, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea42f4a5c994972b1a065a799e64a36e4e1fbb1cf786f2357fa547e4bf47e570
|
|
| MD5 |
ff6d8b6f6c844a766078ba8f9ae85d36
|
|
| BLAKE2b-256 |
c3f19392431b2b9191229d6153be375b81219b6b3a99f7445b88b560ba35c665
|