pgformatter

PostgreSQL SQL syntax beautifier and formatter for readable code

brewmacoslinux
Try with needOr install directly
Source

About

PostgreSQL syntax beautifier

Commands

pgformatter

Examples

Format a SQL file and display output to stdout$ pgformatter /path/to/query.sql
Format SQL file in-place with specific indentation$ pgformatter -i -n 2 /path/to/query.sql
Format SQL from stdin and save to output file$ cat query.sql | pgformatter > formatted_query.sql