pgFormatter vs Poor SQL
pgFormatter
github.comPoor SQL
poorsql.comSide by side
| Figure | pgFormatter | Poor SQL |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | Yes |
| Web | Yes | Yes |
| Windows | — | Yes |
| Linux | Yes | Yes |
| API | Yes | Yes |
| Self-hosted | Yes | — |
| Plans published | 1 | 1 |
| Spec score · SQL Linters and Formatters | 8.2 (#6) | 9.0 (#1) |
| Editor integrations | The README describes use with Vim and (Neo)Vim and links to Atom and Visual Studio Code integrations. | Downloads and repositories provide integrations for SSMS, Visual Studio, Notepad++, WinMerge, Atom, and Visual Studio Code. |
Plans
In their own words
pgFormatter
pgFormatter is free software for formatting PostgreSQL SQL queries and PL/pgSQL code. It supports SQL-92, SQL-99, SQL-2003, SQL-2008, SQL-2011 and PostgreSQL syntax, and the project says it also works with other databases. You can run it as a console program or CGI application that returns text or HTML; a CGI request with an application/json Accept header can return JSON. Formatting controls cover keyword, function, identifier and type case, indentation, query wrapping and comma placement. The --anonymize option hides query literals before formatting. The project documents source installation with Perl Makefile.PL, make and make install, Docker use, Vim and (Neo)Vim integration, Atom and Visual Studio Code links, and a pre-commit hook for SQL files. An online demo limits queries to ten thousand characters. It is distributed under the PostgreSQL Licence at free.
Poor SQL
Poor SQL reformats and colorizes T-SQL according to settings such as indentation, tab spacing, maximum width, and where statements and clauses break. It can expand comma lists, boolean and CASE expressions, and JOIN ON sections. Formatting runs in the browser, including offline, and the site says submitted SQL is not sent to an external service. Output views include input SQL, formatted SQL, and HTML source. An obfuscation and minification option can vary colors, line lengths, and keyword case, or substitute keywords. Downloads include plugins for SQL Server Management Studio, Visual Studio, and WinMerge, plus a command-line bulk formatter. The open-source Poor Man’s T-SQL Formatter library is AGPL-licensed and supports Microsoft.NET and Mono; its JavaScript library works in browsers and contexts such as Node.js. The project describes its parsing as coarse rather than full, especially for DDL. The free plan is free. Settings are remembered with a cookie; blocking cookies restores defaults on each visit.