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
Metadata
Release files for tree-sitter-sql 0.3.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tree_sitter_sql-0.3.11.tar.gz | 834.5 kB | Details |
Built distributions (wheels)
Total release size: 3.7 MB
Release files / tree_sitter_sql-0.3.11.tar.gz
| Download URL | tree_sitter_sql-0.3.11.tar.gz |
|---|---|
| Size | 834.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
700b93be2174c3c83d174ec3e10b682f72a4fb451f0076c7ce5012f1d5a76cbc
|
|
BLAKE2b-256 checksum How to use checksums |
e85c3d10387f779f36835486167253682f61d5f4fd8336b7001da1ac7d78f31c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-win_arm64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 333.5 kB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
8a1e42f0a2c9b01b23074708ecf5b8d21b9a0440e3dff279d8cf466cdf1a877e
|
|
BLAKE2b-256 checksum How to use checksums |
7760f10b8551f435d57a4748820ee30e66df2682820b2972375c2b89d2e5fb10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-win_amd64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 343.6 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c57b877702d218c0856592d33320c02b2dc8411d8820b3bf7b81be86c54fa0bb
|
|
BLAKE2b-256 checksum How to use checksums |
ebb357ff42dadd33c06fabe6c725de50e1625e1060f1571cc21a9260febadc1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 379.4 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0e22ea8de690dd9960d8c0c36c4cd25417b084e1e29c91ac0235fbdb3abb4664
|
|
BLAKE2b-256 checksum How to use checksums |
52e9a7afd7f68ce165c040ce50e67bb05553784a8e17f37e057405d693fc869d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 380.9 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
03cc164fcf7b1f711e7d939aeb4d1f62c76f4162e081c70b860b4fcd91806a38
|
|
BLAKE2b-256 checksum How to use checksums |
941d06e9598799bd119e56f6e431d42c2f3a5c6dee858a5b6ad7633cc4d670aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 380.6 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5128b12f71ac0f5ebcc607f67a62cdc56a187c1a5ba7553feeb9c5f6f9bc3c72
|
|
BLAKE2b-256 checksum How to use checksums |
1dc1eec7c09a9c94436ea4c56d096feba815e42b209b3d41a17532f99ecf0c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 381.2 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
344e99b59c8c8d72f7154041e9d054400f4a3fccc16c2c96ac106dde0e7f8d0c
|
|
BLAKE2b-256 checksum How to use checksums |
8e967cee5661aa897e5d1a67499944ea5cf8a148953c1dc07a3059a50db8cb56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 341.6 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a33cd6880ab2debef036f80365c32becb740ec79946805598488732b6c515fff
|
|
BLAKE2b-256 checksum How to use checksums |
0545b2bd5f9919ea15c4ae90a156999101ebd4caa4036babe54efaf9d3e77d55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tree_sitter_sql-0.3.11-cp310-abi3-macosx_10_9_x86_64.whl
| Download URL | tree_sitter_sql-0.3.11-cp310-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 322.0 kB |
| Tags | CPython 3.10 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
cf1b0c401756940bf47544ad7c4cc97373fc0dac118f821820953e7015a115e3
|
|
BLAKE2b-256 checksum How to use checksums |
3268bb80073915dfe1b38935451bc0d65528666c126b2d5878e7140ef9bf9f8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|