v.21.11Improvements

clickhouse-format now supports --query option

clickhouse-format now supports option --query. In previous versions you have to pass the query to stdin. #29325 (凌涛).
clickhouse-format now supports the --query option to format SQL queries passed directly as arguments.

Why it matters

Previously, users had to provide the SQL query to clickhouse-format via standard input (stdin), which was less convenient for scripting and quick formatting. This feature improves usability by allowing queries to be formatted directly from the command line, enhancing workflow efficiency.

How to use it

Use the --query option followed by the SQL query string to format a query directly. For example:

clickhouse-format --query "SELECT * FROM table WHERE id = 1"