2025-07-31

SQL in Neovim#

Formatting / Language Servers for SQL via Mason#

sql-formatter#

  • nodejs

sqlfluff#

  • python

  • duckdb explicitly supported

sqlfmt#

  • python

sqls#

  • superseded by sqlls

sqlls#

Formatting using Sleek#

As suggested by DanCardin on Reddit I tried nrempel/sleek and liked it, because it is fast and there simply is no configuration. :D

Here’s my conform config: felixhummel/nvim

Dadbod#

Check the intro video by TJ, then get vim-dadbod-ui which uses the venerable Tim Pope’s vim-dadbod.

To open a local duckdb file called foo (note the three slashes in its URL):

:DB duckdb:///foo SELECT * FROM information_schema.tables;

Postgres via Unix domain socket on different port:

:DB postgresql://%2Frun%2Fpostgresql/felix?port=5433

URL-Quote /run/postgresql:

sed -e 's;/;%2F;g' <<< /run/postgresql