8 releases

0.3.11 Oct 1, 2025
0.3.10 Sep 24, 2025
0.3.8 Feb 13, 2025
0.3.7 Nov 21, 2024
0.3.3 Jul 30, 2024

#157 in Parser implementations

Download history 4757/week @ 2025-11-20 3609/week @ 2025-11-27 3865/week @ 2025-12-04 3608/week @ 2025-12-11 2710/week @ 2025-12-18 2554/week @ 2025-12-25 3262/week @ 2026-01-01 4101/week @ 2026-01-08 5011/week @ 2026-01-15 6773/week @ 2026-01-22 6660/week @ 2026-01-29 7465/week @ 2026-02-05 5190/week @ 2026-02-12 4832/week @ 2026-02-19 4012/week @ 2026-02-26 5628/week @ 2026-03-05

20,324 downloads per month
Used in 26 crates (19 directly)

MIT license

18MB
676K SLoC

C 675K SLoC // 0.0% comments JavaScript 645 SLoC // 0.8% comments Scheme 444 SLoC Rust 31 SLoC // 0.1% comments

tree-sitter-sql

Build/test GitHub Pages npm package version

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

Other projects

Dependencies