-- Database integration with vim-dadbod -- Supports PostgreSQL, MySQL, SQLite, and more -- All three plugins are lazy-loaded: -- - vim-dadbod loads on :DB / :DBUI* commands -- - dadbod-ui loads on its own UI commands -- dadbod-completion loads on sql/mysql/plsql filetypes -- -- Keymaps live in config/keymaps.lua under the D group. return { -- Core dadbod plugin { "tpope/vim-dadbod", cmd = { "DB", "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" }, }, -- UI for dadbod { "kristijanhusak/vim-dadbod-ui", cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" }, dependencies = { "tpope/vim-dadbod", { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } }, }, init = function() -- UI configuration vim.g.db_ui_use_nerd_fonts = 1 vim.g.db_ui_show_database_icon = 1 vim.g.db_ui_force_echo_notifications = 1 -- Save location for connections vim.g.db_ui_save_location = vim.fn.stdpath("data") .. "/db_ui" -- Execute on save vim.g.db_ui_execute_on_save = 0 -- Icons vim.g.db_ui_icons = { expanded = "▾", collapsed = "▸", saved_query = "*", new_query = "+", tables = "~", buffers = "»", connection_ok = "✓", connection_error = "✕", } end, }, -- Completion { "saghen/blink.cmp", opts = { sources = { default = { "lsp", "path", "snippets", "buffer" }, per_filetype = { sql = { "snippets", "dadbod", "buffer" }, }, -- add vim-dadbod-completion to your completion providers providers = { dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" }, }, }, }, }, }