Skip to content

Commit 504f675

Browse files
committed
fix(feat): complete sql format configuration
1 parent ccbb38b commit 504f675

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
A lightweight, high-performance SQL formatter plugin for Neovim that leverages `sqlparse` for optimal formatting results with a Lua fallback for basic formatting.
44

5+
## Images
6+
<p float="left">
7+
<img src="https://raw.githubusercontent.com/andev0x/description-image-archive/refs/heads/main/sql-formatter/p1.png" width="300" />
8+
<img src="https://raw.githubusercontent.com/andev0x/description-image-archive/refs/heads/main/sql-formatter/p2.png" width="300" />
9+
</p>
10+
511
## Features
612

713
- 🚀 **High Performance**: Uses external `sqlparse` formatter for speed
@@ -33,15 +39,14 @@ pip install sqlparse
3339

3440
```lua
3541
{
36-
"andev0x/sql-formatter.nvim",
37-
ft = { "sql", "mysql", "plsql", "pgsql" },
38-
config = function()
39-
require("sql-formatter").setup({
40-
format_on_save = true,
41-
dialect = "postgresql",
42-
})
43-
end,
44-
}
42+
"andev0x/sql-formatter.nvim",
43+
ft = { "sql", "mysql", "plsql", "pgsql" },
44+
config = function()
45+
vim.g.sqlformat_command = "sqlformat"
46+
vim.g.sqlformat_options = "-r -k upper"
47+
vim.g.sqlformat_prog = "sqlformat"
48+
end,
49+
},
4550
```
4651

4752
#### packer.nvim

0 commit comments

Comments
 (0)