Teradata + Neovim¶
Fast, keyboard-first Teradata development inside Neovim. This ecosystem brings:
- vim-teradata: run queries via Teradata BTEQ, manage jobs & bookmarks, edit result grids, and get diagnostics powered by Tree-sitter.
- tree-sitter-teradata: a dedicated Teradata SQL grammar (
teradataparser) providing accurate syntax checking and AST support. - sql-autocomplete: schema-aware completion (databases → tables → columns) powered by a local metadata index, with first-class blink.cmp, nvim-cmp, or omnifunc integration.
Target audience: Teradata developers, DBAs, and data analysts who know SQL (Neovim experience not required).
Goals: quick install → immediate usage → clear troubleshooting.
Non-goals: teaching SQL, generic Teradata setup, non-BTEQ clients.
What is Neovim + Tree-sitter?¶
If you come from graphical database tools, you might wonder what Neovim and Tree-sitter are and why they are paired together for Teradata development:
- Neovim is a modern, hyper-fast, modal terminal text editor (an extensible fork of Vim). Instead of relying on heavy graphical interfaces and mouse clicks, Neovim enables you to navigate, edit, and manipulate code purely with keyboard commands. It starts in milliseconds, uses negligible system memory (< 50 MB), and runs identically on your local machine, inside WSL, or over SSH on remote jump hosts.
- Tree-sitter is a next-generation incremental parsing library built directly into Neovim. Traditional editors highlight and inspect code with regular expressions, which easily fail on complex, multiline SQL queries, subqueries, or dialect-specific clauses. Tree-sitter builds and maintains a concrete Abstract Syntax Tree (AST) of your SQL file in memory as you type.
Together, Neovim and Tree-sitter provide:
- Precise statement detection: The plugin knows exactly where each SQL statement begins and ends based on syntax tree nodes—not naive semicolon splitting—so semicolons inside strings or comments never break execution.
- Real-time syntax diagnostics: Catch syntax errors, unclosed strings, and misplaced clauses immediately in the editor buffer before sending requests to the database.
- AST-aware navigation & formatting: Jump between clauses, format queries cleanly, and apply context-aware code actions.
How it works: running queries via BTEQ¶
Rather than relying on generic, heavy JDBC/ODBC drivers, vim-teradata executes queries directly through Teradata's battle-tested command-line engine: BTEQ (Basic Teradata Query).
┌──────────────────────┐
│ Neovim (SQL Buffer) │
└──────────┬───────────┘
│
▼ 1. Extract statement via Tree-sitter AST & substitute parameters (${DB})
┌──────────────────────┐
│ vim-teradata Core │
└──────────┬───────────┘
│
▼ 2. Spawn async BTEQ process (vim.system) or stream via stdin pipe
┌──────────────────────┐
│ Teradata BTEQ (TTU) │ ──► Passwordless authentication via tdwallet
└──────────┬───────────┘
│
▼ 3. Execute query on Teradata DBS & stream delimited output / errors
┌──────────────────────┐
│ Background Job / UI │
├──────────────────────┤
│ • Job Manager (:TDJ) │ ──► Real-time execution tracking
│ • Result Split Grid │ ──► Tabular display with navigation & in-grid editing
│ • Query History │ ──► Searchable archive of queries and results (:TDR)
└──────────────────────┘
The execution pipeline works in three main stages:
- Statement extraction & substitution:
When you run
:[N]TDO(or visual selection:[range]TDV), the plugin queries the Tree-sitter AST to extract the exact boundary of the statement under the cursor. Any configured template variables (such as${DB_NAME}) are substituted before sending. - BTEQ invocation:
- One-shot execution (default): Neovim asynchronously launches a background
bteqprocess usingvim.system. The plugin automatically injects secure credentials viatdwallet($tdwallet(<user>)), sets session formatting options (field separators, NULL representations, title dashes, and row limits viaretlimit), runs the SQL script, and exits. - Persistent sessions (
:TDSession): For workflows requiring volatile tables, session query bands, or multi-step transactions,vim-teradatakeeps an active BTEQ process running in the background connected via standard I/O pipes. Queries are dispatched between.REMARKmarkers without reconnecting or re-authenticating, preserving session state. - Non-blocking results & history:
Because execution is completely asynchronous, Neovim never freezes while waiting for long-running queries. You can monitor progress in the Job Manager (
:TDJ), cancel running queries at any time, and review output in an interactive, navigable split table. The query and its metadata are automatically logged to local history (:TDR). For large-scale data extraction exceeding row limits, the plugin seamlessly offloads to Teradata Parallel Transporter (TPT /tbuild) via:TDExport.
Comparison: vim-teradata vs. GUI tools¶
Teradata users commonly work with DBeaver, Teradata Studio, or the legacy Teradata SQL Assistant. Here is how vim-teradata compares:
| Feature / Dimension | vim-teradata (Neovim) |
Teradata Studio | DBeaver | Teradata SQL Assistant |
|---|---|---|---|---|
| Category | Keyboard-first modal editor | Official Teradata IDE (Eclipse) | Universal DB GUI (Eclipse) | Legacy Teradata GUI (ODBC) |
| Status | Actively developed | Maintenance mode | Actively developed | Deprecated / Retired |
| Interface | Terminal / GUI (Pure keyboard) | Heavy GUI (Mouse-driven) | Heavy GUI (Mouse-driven) | Classic Windows GUI |
| Resource usage | Very low (~20–50 MB RAM, 0% CPU idle) | Heavy (~1–2+ GB RAM, high CPU) | High (~500 MB–1.5 GB RAM) | Moderate (32-bit legacy) |
| Startup time | Instantaneous (< 50 ms) | Slow (15–30+ seconds) | Moderate (5–15 seconds) | Fast (Windows only) |
| Remote / SSH / Headless | Native (runs in tmux, SSH, WSL) | No (requires X11, VNC, or RDP) | No (requires remote desktop) | No (Windows only) |
| Teradata Engine | Native BTEQ, TPT, tdwallet | Teradata JDBC Driver | Teradata JDBC Driver | Teradata ODBC Driver |
| Syntax & Diagnostics | Tree-sitter AST (real-time linting) | Basic Eclipse SQL editor | Standard SQL tokenizer | Basic keyword highlighter |
| Volatile Tables | Supported via :TDSession |
Supported (session connection) | Supported (single connection mode) | Supported |
| Bulk Data Export | TPT (FastExport / Selector) in background | Slow JDBC export / wizard | Slow JDBC export / wizard | Basic file export |
| Visual ERDs / Schema Trees | No (schema completion via :TDSync) |
Yes | Yes | Basic database tree |
| In-grid Editing | Generates staged UPDATE statements |
Cell-level GUI editing | Cell-level GUI editing | Read-only grids |
Why choose vim-teradata?¶
- Unmatched speed and efficiency: If you spend your day writing, testing, and debugging Teradata SQL, switching back and forth between a heavy GUI and an external editor slows you down. With Neovim, everything happens with concise keyboard shortcuts without leaving your terminal.
- Native Teradata Tooling (TTU): Rather than dealing with generic JDBC driver quirks,
vim-teradataleverages Teradata's native utilities:bteqfor query execution,tbuild(TPT) for multi-session high-speed exports, andtdwalletfor passwordless security. - Pre-execution syntax diagnostics: Tree-sitter catches syntax and grammar errors as you type, saving you from waiting for a server round-trip only to find a misplaced comma or missing keyword.
- First-class remote development: Work directly on remote bastion hosts, ETL servers, or cloud instances over SSH without laggy X11/VNC desktop streaming.
When to use GUI tools instead?¶
- Visual point-and-click tasks: If your primary workflow involves exploring unfamiliar schemas through visual tree hierarchies, generating visual Entity-Relationship (ER) diagrams, or using graphical query builders, DBeaver or Teradata Studio are better suited.
- Multi-database environments: If you frequently query Teradata alongside Oracle, PostgreSQL, Snowflake, and MySQL in a single unified interface, DBeaver's universal JDBC support is a natural fit.
Key features¶
- Query execution via BTEQ: Run single queries, multistatement batches, visual ranges, re-run queries instantly (
:TDRerun), maintain persistent sessions (:TDSession) for volatile tables and session state, and track background jobs in the Job Manager UI. - Tree-sitter diagnostics: Fast syntax and reference linting for Teradata SQL statements.
- Schema-aware autocompletion: Native completion for tables, columns, and databases supporting
blink.cmp,nvim-cmp, andomnifunc(<C-X><C-O>). - Query history & bookmarks: Search past queries and result sets using your choice of picker (
fzf-lua,snacks,telescope,fzf.vim, or built-innativepicker). - Full exports via TPT: Export large datasets directly to disk in the background with
:TDExportorF, featuring intelligent routing between multi-sessionEXPORT(FastExport) andSELECTORoperators. - In-grid editing: Edit query result tables directly with staged preview and
UPDATEstatement generation. - Virtual answersets & quick-calc: In-grid summary footers (
sum,avg,min,max,count,nulls,distinct), visual stats popups (<leader>=), Tree-sitter parsed computed columns (:TDCol), exact Teradata SQL pushdown (gD), and volatile-table materialization (:TDMaterialize) for sandboxed what-if modeling. - Multiple connection profiles: Fast switching backed by tdwallet for passwordless secure authentication.
- Health check: Built-in
:checkhealth vim-teradatato inspect configuration, TTU binaries, tree-sitter parsers, and connection profiles.
Get started in minutes → Quickstart.