sql-ghosty.nvim adds ghost text inlay hints to your SQL insert statements.
Addresses the challenge of managing SQL inserts with numerous columns, where it’s difficult to map values to their corresponding columns. It embeds hints with the column name alongside each value.
Another approach I sometimes use, is to align the statement with a plugin like mini.align and edit it in visual-block mode. These approaches are complementary, each valuable in different scenarios, allowing me to choose the best method based on the context.
- robust SQL parsing by leveraging tree-sitter
- ability to toggle hints with the
:SqlInlayHintsTogglecommand
- nvim-treesitter with SQL parser installed
vim.pack.add({
{ src = "https://github.com/pmouraguedes/sql-ghosty.nvim" },
})
require("sql-ghosty").setup({}){
"pmouraguedes/sql-ghosty.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
opts = {},
}{
-- if set to false the user needs to enable hints manually with :SqlInlayHintsToggle
show_hints_by_default = true,
highlight_group = "DiagnosticHint",
}:SqlInlayHintsToggle- toggle hint display
