v.21.4Improvements

Add --backslash option to clickhouse-format for line-ending backslashes

Add option --backslash for clickhouse-format, which can add a backslash at the end of each line of the formatted query. #21494 (flynn).
Add a --backslash option to the clickhouse-format tool that appends a backslash at the end of each line in the formatted SQL query.

Why it matters

This feature helps users produce formatted SQL queries with line continuation characters (backslashes) at the end of each line, facilitating multi-line query handling or copy-pasting query snippets into scripts or interactive environments where backslash continuation is needed.

How to use it

Run clickhouse-format with the --backslash option. For example:

clickhouse-format --backslash < input.sql

This will output the formatted query with a backslash appended at the end of every line.