dotfiles/.config/nvim/lua/config/dadbod.lua

30 lines
602 B
Lua
Raw Normal View History

2024-07-03 20:44:47 +01:00
local M = {}
local function db_completion()
require("cmp").setup.buffer { sources = { { name = "vim-dadbod-completion" } } }
end
function M.setup()
vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
},
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"sql",
"mysql",
"plsql",
},
callback = function()
vim.schedule(db_completion)
end,
})
end
return M