Autocomplete¶
sql-autocomplete provides schema-aware suggestions once you run :TDSync.
Metadata sync (:TDSync)¶
- Builds a local index of databases → tables → columns from your active connection.
- Typical duration: ~2 minutes for a few million columns.
- Requires read access to
dbc.columnsv. - Filter database scope using the
filter_dboption. - When catalog definitions or DDL changes on the system, re-run
:TDSyncmanually to update the index.
Storage location:
vim.fn.stdpath('data') .. '/teradata'(configurable viadata_dir)
Completion behavior¶
- Scope-aware suggestions:
- After
FROMorJOIN: completes databases, then tables. - After
<table>.: completes columns belonging to that table. - Teradata built-in SQL functions are always suggested.
- After
- Case-insensitive matching.
- Candidate ranking and fuzzy matching are handled by your completion plugin.
Supported engines¶
blink.cmp¶
Automatically registered as a completion provider if blink.cmp is detected.
nvim-cmp¶
Automatically registered if nvim-cmp is detected. Simply add td_sql_completion to your sources list:
cmp.setup({
sources = {
{ name = 'td_sql_completion' },
-- your other sources...
},
})
Built-in omnifunc (<C-X><C-U>)¶
If you do not use blink.cmp or nvim-cmp, you can invoke native Neovim completion anywhere in a Teradata buffer using insert-mode <C-X><C-U>.