v.24.1New Feature

clickhouse-format enhancements: INSERT query support, comment handling, and max line length option

clickhouse-format improvements: support INSERT queries with VALUES; support comments (use --comments to output them); support --max_line_length option to format only long queries in multiline. #58246 (vdimir).
clickhouse-format improvements including support for INSERT queries with VALUES, handling of comments, and a new --max_line_length option for multiline formatting.

Why it matters

These enhancements improve the usability and flexibility of the clickhouse-format tool by enabling proper formatting of INSERT statements with VALUES clauses, allowing users to preserve and output comments, and providing control over when queries are formatted into multiline style based on their length.

How to use it

To format INSERT queries including VALUES, simply pass the query to clickhouse-format. Use the --comments option to preserve SQL comments in the output. To format only queries exceeding a certain length into multiline, use the --max_line_length option followed by the desired maximum number of characters.