v.24.1New Feature
clickhouse-format enhancements: INSERT query support, comment handling, and max line length option
clickhouse-formatimprovements: support INSERT queries withVALUES; support comments (use--commentsto output them); support--max_line_lengthoption to format only long queries in multiline. #58246 (vdimir).
Why it matters
These enhancements improve the usability and flexibility of theclickhouse-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 formatINSERT 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.