Sql grammar for tree-sitter
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
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
Release history Release notifications | RSS feed
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
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23404d1eabdd7aac44c9202b506997bb22151c96e1adccc28fe83ae3887711f8 |
|
MD5 | bfc869c6afc3b63b1c9a292826648baa |
|
BLAKE2b-256 | 8edeff5139b8ea546c6e4c8c185ee09ffc055183d35def00251566b8018aaed7 |
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2be67259947c767d697867cae4b1e978a6f1a4222ea787f3f8abf86b3aca02d9 |
|
MD5 | 5b30686aa7033fd8c3b8accedfcdb80c |
|
BLAKE2b-256 | 416a265d91aec8aa8761b2745643ef728bc8aeef6bb53d68feb84a926a5ac703 |
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d19e13fca1efc6f8e029ca0b28cd447f98be40e5179e21eab76c07963f8a70cd |
|
MD5 | 9364aaaf8cf2e647cc98a76edb4e4939 |
|
BLAKE2b-256 | 1d8d0dca009fdafa7d49649a50298a8ac1ea39284d65ff25cb7b06fdf61f6229 |
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5934cf1b8d235ca94c84fa39b0f85c1718c2ee2e059a9d41b357c837beb4802f |
|
MD5 | 4be3f4d28d333ddd67ef5ef69bae44cd |
|
BLAKE2b-256 | 4d47644c94046fa0de4ff69ee3a5aa8d0645c702714287bb5f9f9e1ad85e4d57 |
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 628e78455ef35b64c0686f399684cd620aeed8ae4b965f38a98cf4bfb7fdf47c |
|
MD5 | 885655876cbdcd82be57fb28539d3927 |
|
BLAKE2b-256 | b42c78dc1521d0fa59a79954eb7591a3ed081dc1ebc5888a4ce6be00aaac5003 |
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc2a770c7508fddb2a6e8daec6c0db5543386b30f625f89a752fb2b534187367 |
|
MD5 | 24caecddde812c892db99ecee77a084f |
|
BLAKE2b-256 | c50e3e095983d6cfe7a874d14a595068050cd38b1c0701b04233e2161f93c0e2 |
Hashes for tree_sitter_sql-0.3.5-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a00aed92d96e4665715dc9b14d5e5619514fda2f8c20c0e39993c335453dc1b |
|
MD5 | 28ec2109f976b6e49ab2332ed8eb0663 |
|
BLAKE2b-256 | 019562270e17caced7280fc149a50323542e8dfd4d0e945aa82332c08653e9aa |