v.22.1Improvement

--echo option not used by clickhouse-client in batch mode with single query

--echo option was not used by clickhouse-client in batch mode with single query. #32843 (N. Kolotov).
Add support for --echo option in clickhouse-client batch mode with single query.

Why it matters

Previously, the --echo option was ignored when running clickhouse-client in batch mode with a single query, preventing users from seeing the executed queries in the output. This update ensures that the queries are echoed back even in batch mode, improving logging, debugging, and user feedback during automated or scripted executions.

How to use it

To enable this feature, run clickhouse-client in batch mode with the --echo option followed by your single query. For example:

clickhouse-client --batch --echo --query="SELECT * FROM table"