A home for the client config that is not a dotfolder
clickhouse-client looked for ~/.clickhouse-client/config.xml. I asked for the XDG location; it shipped in 25.12, with a slightly different path than I proposed.
Source: github.com
clickhouse-client read its configuration from ~/.clickhouse-client/config.xml, a dotfolder in the 1990s style. Newer tools follow the XDG Base Directory specification and keep configuration under ~/.config/<tool>/ or $XDG_CONFIG_HOME, which matters if you version-control or sync your config. I asked for the XDG location first, with the legacy path as fallback, and proposed ~/.config/clickhouse-client/config.xml.
It went fast. The maintainer answered “Good proposal, I’d like it!” the same night, the issue was labelled easy task, and a contributor’s PR #90306 merged on 2025-11-19, eight days after I filed it. It shipped in 25.12 with a different directory than I proposed: clickhouse, not clickhouse-client. The search order is ./.clickhouse-client/, then $XDG_CONFIG_HOME/clickhouse/ (default ~/.config/clickhouse/), then the legacy ~/.clickhouse-client/, then /etc/clickhouse-client/.
The path I proposed is ignored, which I confirmed on 26.4 with an unresolvable host as a probe:
H=$(mktemp -d); mkdir -p $H/.config/clickhouse
echo '<config><host>xdg-host.invalid</host></config>' > $H/.config/clickhouse/config.xml
HOME=$H clickhouse client -q "select 1"
Code: 198. DB::NetException: Not found address of host: xdg-host.invalid. (DNS_ERROR)
The same file under .config/clickhouse-client/ gives the default “Connection refused (localhost:9000)”, meaning it was never read.
Discussion
Comments live in GitHub Discussions. Sign in with GitHub to join in.