Skip to content

Support multi-statement cloud query files - #344

Closed
sdairs wants to merge 1 commit into
codex/issue-323-openapi-driftfrom
codex/issue-333-cloud-query-files
Closed

Support multi-statement cloud query files#344
sdairs wants to merge 1 commit into
codex/issue-323-openapi-driftfrom
codex/issue-333-cloud-query-files

Conversation

@sdairs

@sdairs sdairs commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • split cloud service query --queries-file input into ClickHouse-aware statements
  • send each statement to the Query API sequentially, stream responses in order, and stop on the first failure
  • support quoted strings and identifiers, ClickHouse comment forms, heredocs, Unicode quotes, and inline INSERT ... FORMAT data boundaries
  • document independent-request/session-state and partial-application behavior

Root cause

The Query API accepts one SQL statement per request, but the CLI read a query file into one string and submitted the entire file in a single request. Local client --queries-file delegates to the native ClickHouse client, which already processes multi-statement files.

Impact

Multi-statement files, including --queries-file -, now execute in file order. Authentication, service resolution, and any Query API provisioning happen once. Earlier statements and output remain visible if a later statement fails; statements after the failure are not submitted.

Each statement is an independent Query API request, so persistent DDL/DML changes carry forward but connection-local state such as USE, SET, temporary tables, and transactions does not.

Stack

Validation

  • cargo fmt --all --check
  • cargo build -p clickhousectl --all-targets
  • cargo test -p clickhousectl
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

@sdairs
sdairs temporarily deployed to cloud-integration July 31, 2026 13:40 — with GitHub Actions Inactive
@sdairs sdairs closed this Jul 31, 2026
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.

1 participant