From d71bdcddd77f5f86140a3bd713c2c0c845b5119b Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 15 Nov 2024 21:42:58 -0800 Subject: [PATCH] sql setup --- lua/plugins/conform.lua | 8 +++++--- lua/plugins/nvim-lint.lua | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 lua/plugins/nvim-lint.lua diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index c23d8b8..0f8a903 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -1,9 +1,11 @@ return { "stevearc/conform.nvim", opts = { - formatters_by_ft = { - sql = { "sql_formatter" }, - -- nix = { "nixpgs_fmt" }, + formatters = { + sqlfluff = { + args = { "format", "--dialect=sqlite", "-" }, + }, }, }, + setup = {}, } diff --git a/lua/plugins/nvim-lint.lua b/lua/plugins/nvim-lint.lua new file mode 100644 index 0000000..e53f75c --- /dev/null +++ b/lua/plugins/nvim-lint.lua @@ -0,0 +1,15 @@ +return { + "mfussenegger/nvim-lint", + opts = { + linters = { + sqlfluff = { + args = { + "lint", + "--format=json", + -- note: users will have to replace the --dialect argument accordingly + "--dialect=sqlite", + }, + }, + }, + }, +}