Tree‑sitter (Teradata SQL)¶
The tree-sitter-teradata parser is a modified tree-sitter-sql tailored to Teradata. It overrides
Neovim's sql parser so diagnostics reflect Teradata grammar.
Download¶
- Parser libraries (Linux/macOS/Windows): https://github.com/ErwonB/tree-sitter-teradata/releases/tag/v0.1.1
- Queries directory: https://github.com/ErwonB/tree-sitter-teradata/tree/main/queries
Install locations¶
Neovim loads parsers from any directory on runtimepath under parser/ and queries under queries/sql/.
Use these typical paths (create folders if they don't exist):
Linux¶
- Parser:
~/.local/share/nvim/site/parser/sql.so - Queries:
~/.local/share/nvim/site/queries/sql/
macOS¶
- Parser:
~/.local/share/nvim/site/parser/sql.dylib - Queries:
~/.local/share/nvim/site/queries/sql/
Windows¶
- Parser:
%LOCALAPPDATA% vim-data\site\parser\sql.dll - Queries:
%LOCALAPPDATA% vim-data\site\queries\sql\
Tip: In Neovim, you can inspect standard paths with:
:lua print(vim.fn.stdpath('data')) :lua print(vim.o.runtimepath)
Copy the released parser library file to the parser/ path and copy the entire contents of the
queries folder into queries/sql/ to replace the default sql queries.
Enable per filetype (optional)¶
vim-teradata exposes an ft option to explicitly enable diagnostics for certain filetypes:
require('vim-teradata').setup({
ft = { 'sql' }, -- enable Teradata diagnostics in these filetypes
-- ...your other settings
})
Verify¶
Run:
:checkhealth treesitter
You should see sql with the Teradata parser loaded. Open a .sql file and introduce an obvious syntax
error to see a diagnostic ERROR.