Our great sponsors
-
pgFormatter
A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI. On-line demo site at http://sqlformat.darold.net/
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I have found this https://github.com/darold/pgFormatter, but I am not sure if there is something else that I haven't discovered yet.
I’m sort of persnickety about using right-aligned keywords and commas first in select and group by lists, etc. I also consider all-caps keywords to be a relic of the times before automated syntax highlighting in editors, and prefer all lowercase most of the time. Not finding anything that satisfied all my preferences (sorta understandable, really) I rolled my own little script using the Python sqlparse library: https://gitlab.com/tym27/sqlf