/tree-sitter-sql

SQL grammar for tree-sitter

Primary LanguageCMIT LicenseMIT

tree-sitter-sql

Build/test

SQL grammar for tree-sitter.

Features

  • SELECT statements (some features may be incomplete)
  • Function calls
  • Index hints
  • Comments
  • Marginalia
  • UPDATE statements
  • DELETE statements
  • CREATE statements
  • INSERT/REPLACE statements
  • DROP statements
  • ALTER TABLE statements
  • CREATE INDEX statements
  • DROP INDEX statements
  • ALTER INDEX statements
  • EXPLAIN statements
  • Function definitions

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 - Note I'm using this as a reference but implementing the Grammar in terms of the MySQL dialect of SQL.

Other projects