If you work with databases and love Neovim, you'll appreciate nvim-dbee - a plugin that turns Neovim into a powerful database client. Unlike alternatives like vim-dadbod, nvim-dbee doesn't require CLI tools, making it perfect for Docker-based workflows.
In this post, I'll show you how to set it up and supercharge it with SQL linting and formatting.
Using lazy.nvim:
{
"kndndrj/nvim-dbee",
cmd = "Dbee", -- Lazy-load on command
dependencies = { "MunifTanjim/nui.nvim" },
build = function()
require("dbee").install("curl") -- Requires `curl`
end,
opts = {}, -- Add custom config here
}
I'm using these tools for my SQL workflow on Neovim.
Use this snippet to enable sqruff.
-- For lazy.nvim
{
"neovim/nvim-lspconfig",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim", -- If you use mason.nvim
},
opts = {
servers = {
sqruff = {}, -- Enable sqruff LSP server
},
},
config = function(_, opts)
local servers = opts.servers
for server, server_opts in pairs(servers) do
vim.lsp.enable(server)
vim.lsp.config(server, server_opts)
end
end,
}
Run :Dbee
in Neovim and connect to your database.
Last update: Apr 17, 2025