v.21.1New Features

Added queries-file parameter for clickhouse-client and clickhouse-local

Added queries-file parameter for clickhouse-client and clickhouse-local. #15930 (Maksim Kita).
Added the queries-file parameter for clickhouse-client and clickhouse-local, allowing users to specify a file containing SQL queries to be executed.

Why it matters

This feature enables users to run multiple SQL queries from a file directly through the clickhouse-client or clickhouse-local interfaces, improving automation and scriptability by avoiding manual input or complex scripting to feed queries.

How to use it

Use the --queries-file option followed by the path to a file containing SQL queries when starting clickhouse-client or clickhouse-local.

Example:

clickhouse-client --queries-file=/path/to/queries.sql


This will execute the queries sequentially from the specified file.