Package Exports
- @derekstride/tree-sitter-sql
- @derekstride/tree-sitter-sql/bindings/node/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@derekstride/tree-sitter-sql) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-pagesUsing 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-pagesStep 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.soUsing Cargo
cargo add tree-sitter-sequelUsing NPM
npm i @derekstride/tree-sitter-sqlDevelopment
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