Skip to content

Preserve native query and query-file multiplicity in local client - #506

Open
sdairs wants to merge 1 commit into
issue-469-direct-client-versionfrom
issue-470-local-client-query-multiplicity
Open

Preserve native query and query-file multiplicity in local client#506
sdairs wants to merge 1 commit into
issue-469-direct-client-versionfrom
issue-470-local-client-query-multiplicity

Conversation

@sdairs

@sdairs sdairs commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve every repeated --query value and forward each as a native query option in source order
  • accept multiple --queries-file paths, including repeated wrapper flags, and emit the native multi-path argv shape
  • reject mixed inline-query and query-file sources as a clear clap usage error, matching native behavior instead of silently reordering
  • keep pass-through arguments after all wrapper-generated arguments and document the behavior in help and README

Closes #470

Decision

Native source for 25.8.32.4 LTS, 25.12.9.61, 26.3.21.7 LTS, 26.7.5.10 stable, and current master uses a repeatable query vector, a multi-token queries-file vector, and rejects the two source types together. The wrapper therefore emits repeated --query pairs, emits one --queries-file followed by every path, and rejects combined forms before resolution or child execution. The JSON output contract in #468 remains unchanged.

Verification

  • cargo fmt --all --check
  • cargo build -p clickhousectl
  • cargo test -p clickhousectl (762 passed)
  • cargo clippy -p clickhousectl --all-targets -- -D warnings
  • parser/help and fake-child matrices cover omitted, single, repeated, empty, ordered, mixed, and -- pass-through forms across the existing 25.x and 26.x client-version fixtures

Stack

@sdairs sdairs changed the title Preserve local client query multiplicity Preserve native query and query-file multiplicity in local client Aug 24, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 133d21b. Configure here.

if let Some(f) = &queries_file {
cmd.arg("--queries-file").arg(f);
if !queries_file.is_empty() {
cmd.arg("--queries-file").args(queries_file);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong queries-file argv forwarding

High Severity

run_client forwards every collected path after a single --queries-file, while --query re-emits the flag per value. Native clickhouse-client expects repeated --queries-file occurrences (one path each). With multiple files, later paths become positionals instead of query sources, so multi-file runs can skip or mis-handle inputs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 133d21b. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve native query and query-file multiplicity in local client

1 participant