MCPcopy Index your code
hub / github.com/DerekStride/tree-sitter-sql

github.com/DerekStride/tree-sitter-sql @v0.3.11

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.11 ↗ · + Follow
40 symbols 76 edges 16 files 1 documented · 2% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

  • https://github.com/m-novikov/tree-sitter-sql
  • https://github.com/tjdevries/tree-sitter-sql
  • https://github.com/dhcmrlchtdj/tree-sitter-sqlite

Core symbols most depended-on inside this repo

make_keyword
called by 373
grammar.js
paren_list
called by 28
grammar.js
parametric_type
called by 26
grammar.js
wrapped_in_parenthesis
called by 21
grammar.js
comma_list
called by 17
grammar.js
unsigned_type
called by 9
grammar.js
optional_parenthesis
called by 8
grammar.js
scan_dollar_string_tag
called by 4
src/scanner.c

Shape

Function 24
Class 11
Method 4
Enum 1

Languages

C35%
Python28%
TypeScript18%
C++10%
Rust5%
Go5%

Modules by API surface

src/scanner.c9 symbols
grammar.js7 symbols
setup.py6 symbols
bindings/python/tree_sitter_sql/binding.c5 symbols
bindings/python/tree_sitter_sql/__init__.py3 symbols
bindings/python/tests/test_binding.py2 symbols
bindings/node/binding.cc2 symbols
bindings/swift/TreeSitterSql/sql.h1 symbols
bindings/rust/lib.rs1 symbols
bindings/rust/build.rs1 symbols
bindings/go/binding_test.go1 symbols
bindings/go/binding.go1 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add tree-sitter-sql \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact