Files
PgTidy/editors/vscode
warkanum f378bf4a18
CI / Test (push) Failing after 39s
CI / Build snapshot (push) Has been skipped
feat(datagrip): add PgTidy formatting action for SQL files
* Implement PgTidyFormatAction to format SQL using pgtidy
* Register action in plugin.xml with keyboard shortcut
* Update dependencies for bundled plugins
* Modify build configuration for Gradle wrapper
2026-06-28 15:24:08 +02:00
..

PgTidy — VSCode Extension

Formats and lints PostgreSQL/PL-pgSQL files using the pgtidy language server.

Requirements

  • pgtidy binary on PATH (see Build the binary below)
  • Go 1.21+ (to build from source)
  • VSCode 1.85+

Build the binary

Option A — install directly with Go (recommended):

go install git.warky.dev/wdevs/pgtidy/cmd/pgtidy@latest

The binary lands in $(go env GOPATH)/bin/. Make sure that directory is on your PATH.

Option B — build from source and place manually:

git clone https://git.warky.dev/wdevs/PgTidy
cd PgTidy
go build -o pgtidy ./cmd/pgtidy

# Linux / macOS — move to a directory on PATH
mv pgtidy /usr/local/bin/

# Windows — move to a directory on PATH, e.g.
# move pgtidy.exe C:\tools\

Verify the binary is reachable:

pgtidy version

If you place it somewhere not on PATH, set the full path in VSCode settings:

"pgtidy.path": "/path/to/pgtidy"

Install from .vsix

  1. Build the package: pnpm run build && pnpm run package
  2. In VSCode: Extensions··· menu → Install from VSIX… → select pgtidy-*.vsix

Or via CLI:

code --install-extension pgtidy-0.1.0.vsix

Settings

Setting Default Description
pgtidy.path "pgtidy" Path to the binary if not on PATH
pgtidy.enable true Enable/disable the language server

Features

  • Format on save — configure via VSCode's editor.formatOnSave
  • Diagnostics — lint findings shown inline as you type (MIG001MIG003, COR001003, NAM001003)
  • Quick fixes — lightbulb actions for MIG001 (add CONCURRENTLY) and MIG003 (add NOT VALID)

.sql and .pgsql files are both handled.

Troubleshooting

No formatting / diagnostics: Open the Output panel → select PgTidy to see server errors. Most common cause: pgtidy not found — set pgtidy.path to the full binary path.