sql-formatter

Formats SQL queries for multiple database languages

brewmacoslinux
Try with needOr install directly
Source

About

Whitespace formatter for different query languages

Commands

sql-formatter

Examples

Format a SQL file and display output$ sql-formatter path/to/query.sql
Format SQL from stdin and write to file$ echo 'SELECT * FROM users WHERE id=1' | sql-formatter > formatted.sql
Format SQL with specific language dialect$ sql-formatter --language postgresql query.sql