Vertica adapter for vim-dadbod, wired through the official vsql client.
Lets you connect to Vertica with the same URL-driven workflow you already use for PostgreSQL/MySQL in dadbod and dadbod-ui — schema browsing, query buffers, result splits, completion.
vsql client on $PATH (see vsql install){
"clang-engineer/dadbod-vertica.nvim",
dependencies = { "tpope/vim-dadbod" },
-- plugin/dadbod-vertica.vim registers dadbod-ui table helpers and patches
-- the schema tree, so it must source on every DBUI entry point — not just
-- the first SQL buffer.
cmd = { "DB", "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
-- optional: only needed if vsql is not on PATH
opts = { vsql = "/opt/vertica/bin/vsql" },
}
use {
"clang-engineer/dadbod-vertica.nvim",
requires = "tpope/vim-dadbod",
config = function()
require("dadbod-vertica").setup({})
end,
}
Plug 'tpope/vim-dadbod'
Plug 'clang-engineer/dadbod-vertica.nvim'
No setup() call needed if vsql is on $PATH.
URL scheme is vertica://:
vertica://user@host:5433/database
vertica://user:password@host:5433/database
Add to vim.g.dbs (for dadbod-ui):
vim.g.dbs = {
{ name = "vertica local", url = "vertica://dbadmin@localhost:5433/VMart" },
{ name = "vertica prod", url = "vertica://reporter@warehouse.corp:5433/ANALYTICS" },
}
Then :DBUIToggle and the entry shows up alongside your other databases.
For one-off queries:
:DB vertica://dbadmin@localhost:5433/VMart SELECT current_user();
require("dadbod-vertica").setup({
vsql = "vsql", -- absolute path if vsql is not on $PATH
})
Or set it directly via vimscript:
let g:dadbod_vertica_vsql = '/opt/vertica/bin/vsql'
Pick one of:
| Method | Notes |
|---|---|
vertica://user:password@host/db URL |
Simplest. Password ends up in ps output — fine for local/throwaway, avoid for shared machines |
VSQL_PASSWORD env var |
Set in your shell rc. Single password for all connections |
| vsql interactive prompt | Works for :DB <url> interactive mode; will hang on non-interactive query buffers |
URL credentials win over env vars.
vsql is not on Homebrew. Download from the official Vertica Client Drivers page (no signup required) and pick the right package for your OS:
vsql-*.mac.dmg — universal binary (x86_64 + arm64). Mount it and copy opt/vertica/bin/vsql onto your $PATH. /usr/local/bin/ is safest because it ships on the default macOS PATH; ~/bin/ works too, but only if your shell rc actually puts ~/bin on $PATH (default zsh does not).rpm or extract the .tar — vsql lands in /opt/vertica/bin/vsqlvsql.exe is placed under %PROGRAMFILES%\Vertica Systems\VSQL\binSkip $PATH entirely by pointing the plugin straight at the binary:
opts = { vsql = "/opt/vertica/bin/vsql" } -- or wherever you put it
Query result buffer is empty / SELECT shows nothing. By default we wrap vsql so its server-side license NOTICE on stderr is discarded — but this also swallows real query errors. Flip the suppressor off to see what vsql is actually saying:
let g:dadbod_vertica_suppress_notice = 0
Re-run the query and the stderr message will land in the result buffer alongside the data.
Neovim freezes when the host is unreachable. vim-dadbod runs vsql synchronously via system(), so a network-unreachable host blocks the UI thread until the TCP connect times out (~75s on macOS by default). vsql has no command-line connect-timeout flag, but you can shorten the wait in your shell rc:
export VSQL_LOGIN_TIMEOUT=5
(Honored by recent vsql builds; behavior is version-dependent.)
v_catalog, v_monitor, v_internal, v_func, v_txtindex system schemas. Override the list via let g:dadbod_vertica_system_schemas = [...] if you need a different exclude set (set it to [] to show everything)pss:schemas dict is script-local with no public hook, so we override db_ui#schemas#get after snapshotting the existing entries. If vim-dadbod-ui adds a new scheme in a later release, this plugin won't expose it until updated — open an issue. Disable the monkey-patch with let g:dadbod_vertica_disable_schema_tree = 1 (tables fall back to a flat list under the DB node)has('unix')). On Windows the Vertica license NOTICE may surface inside result buffersvsql 24.02.x on macOS (universal binary, arm64)If you're using this against a different Vertica version, please open an issue with the version + any errors you see.
MIT