Closed erlangparasu closed 5 months ago
@kristijanhusak Thanks I currently need to add some function
file: lua/plugins/vim-dadbod-ui.lua
return {
"kristijanhusak/vim-dadbod-ui",
cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
dependencies = "vim-dadbod",
keys = {
{ "<leader>D", "<cmd>DBUIToggle<CR>", desc = "Toggle DBUI" },
},
init = function()
-- ...
vim.g.db_ui_table_helpers = {
postgresql = {
Count = "SELECT COUNT(*) FROM {optional_schema}{table}",
Explain = "EXPLAIN ANALYZE {last_query}",
Definition = "\\d+ {optional_schema}{table}",
},
}
end,
}
It works for me. Thanks!
You can override table helpers with https://github.com/kristijanhusak/vim-dadbod-ui/blob/master/doc/dadbod-ui.txt#L416, but you cannot run external commands with it. That's out of scope.