v.25.6New Feature

Add support for the --database argument

Add support for the --database argument in clickhouse-local. You can switch to a previously created database. This closes #44115. #81465 (Alexey Milovidov).
Added support for the --database argument in clickhouse-local, allowing users to switch to a previously created database within local query execution.

Why it matters

This feature enables users to specify a database context when using clickhouse-local, simplifying operations by allowing queries to run against a chosen existing database instead of the default or temporary context. It improves usability and aligns clickhouse-local behavior closer to the server environment.

How to use it

Use the --database argument with clickhouse-local followed by the name of an existing database to switch to that database context, for example:

clickhouse-local --database your_database_name