Side by side
PgSanity vs SQLFormat.org
Both stand on sql linters and formatters. Which one you can start free with, which one lets you read the code, and what each costs once you pay.
Free plan LinuxSelf-hosted
Choose PgSanity if you need a free, MIT-licensed way to check PostgreSQL SQL files from a command line or pre-commit workflow. Its use requires Python 3.9 or later and ecpg, so another option may suit environments that cannot provide those dependencies or need a different SQL dialect.
Visit PgSanity Free plan Open source APIExtensionSelf-hosted+1
SQLFormat.org provides browser-based SQL formatting and a limited API at no listed cost. Note the per-IP API cap and the parser’s non-validating behavior.
Visit SQLFormat.orgThe facts
| PgSanity | SQLFormat.org | |
|---|---|---|
| Free plan | Yes | Yes |
| Open source | Not published | Yes |
| Runs on | Linux, Self-hosted | API, Extension, Self-hosted, Web |
| Lowest paid plan | Free or on request | Free or on request |
| Plans published | 1 | 2 |
| Maker | Not published | Not published |
| Website | github.com | sqlformat.org |
| On sql linters and formatters | #6 of 26 | #2 of 26 |
PgSanity: what it does well
- Checks one or multiple SQL filenames and identifies errors by file and line.
- Reads SQL from standard input when no filenames are provided.
- Returns distinct exit statuses for clean syntax and errors.
- Includes a pre-commit hook named pgsanity_lint.
- Installable with pip or uv, and available through FreeBSD ports.
What to know first
- Requires Python 3.9 or later and ecpg.
- Supports PostgreSQL SQL only.
- Designed for Linux and self-hosted use.
SQLFormat.org: what it does well
- Free browser formatter and API.
- Formatting options include case, indentation, and compact mode.
- Browser SQL is not sent to servers, per the privacy policy.
- API can format SQL and split strings into statements.
What to know first
- API access is limited to 500 requests per hour per IP.
- No specific SQL dialects are listed.
- IP addresses and errors are logged, per the privacy policy.
Alternatives to PgSanity Alternatives to SQLFormat.org The whole list