Skip to content

Support XDG-compliant locations for the ClickHouse Client config file#90306

Merged
thevar1able merged 2 commits intoClickHouse:masterfrom
rainac1:feature/89882-xdg-client-config-path
Nov 19, 2025
Merged

Support XDG-compliant locations for the ClickHouse Client config file#90306
thevar1able merged 2 commits intoClickHouse:masterfrom
rainac1:feature/89882-xdg-client-config-path

Conversation

@rainac1
Copy link
Copy Markdown
Contributor

@rainac1 rainac1 commented Nov 18, 2025

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add support for loading ClickHouse Client configuration from XDG Base Directory paths (e.g., ~/.config/clickhouse/config.xml) in addition to the legacy ~/.clickhouse-client/ location. Resolves #89882

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Details

Resolves #89882.

This PR makes ClickHouse Client compliant with the XDG Base Directory specification.

Configuration Search Order

The client now searches for configuration files in the following order of precedence:

  1. Current directory: ./.clickhouse-client/config.xml (Unchanged)
  2. [New] XDG config home: $XDG_CONFIG_HOME/clickhouse/config.xml (defaults to ~/.config/clickhouse/config.xml if the env var is not set)
  3. Legacy home directory: ~/.clickhouse-client/config.xml (Unchanged, for backward compatibility)
  4. System global: /etc/clickhouse-client/config.xml (Unchanged)

Related Changes

I have also submitted a corresponding PR to the chdig submodule to support XDG paths there as well.

Note that this PR does not update the submodule pointer yet.

@rainac1 rainac1 changed the title Feature/89882 xdg client config path Support XDG-compliant locations for clickhouse-client config file Nov 18, 2025
@rainac1 rainac1 changed the title Support XDG-compliant locations for clickhouse-client config file Support XDG-compliant locations for the ClickHouse Client config file Nov 18, 2025
@thevar1able thevar1able self-assigned this Nov 18, 2025
@thevar1able thevar1able added the can be tested Allows running workflows for external contributors label Nov 18, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Nov 18, 2025

Workflow [PR], commit [513ac9a]

Summary:

job_name test_name status info comment
Integration tests (amd_tsan, 3/6) failure
test_restore_db_replica/test.py::test_query_after_restore_db_replica[alter table-with exists table-no restart] FAIL cidb, flaky
Integration tests (amd_tsan, 5/6) failure
test_storage_nats/test_nats_jet_stream.py::test_nats_no_connection_at_startup_2 FAIL cidb
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting: the query: FAIL cidb
BuzzHouse (amd_msan) failure
Let op! ERROR cidb
BuzzHouse (amd_ubsan) failure
Received signal 17 FAIL cidb

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Nov 18, 2025
@thevar1able
Copy link
Copy Markdown
Member

test_storage_nats/test_nats_jet_stream.py::test_nats_no_connection_at_startup_2

#80947

test_restore_db_replica/test.py::test_query_after_restore_db_replica[alter table-with exists table-no restart]

#85664

Logical error: 'Inconsistent AST formatting: the query:

#90208

Received signal 17

#90458

@thevar1able thevar1able added this pull request to the merge queue Nov 19, 2025
Merged via the queue into ClickHouse:master with commit 4096d0d Nov 19, 2025
126 of 132 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 19, 2025
@rainac1 rainac1 deleted the feature/89882-xdg-client-config-path branch November 20, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow clickhouse-client config file in XDG-compliant location

3 participants