Add cloud service query for HTTP SQL execution (stacked on #120)#121
Closed
sdairs wants to merge 1 commit into
Closed
Add cloud service query for HTTP SQL execution (stacked on #120)#121sdairs wants to merge 1 commit into
sdairs wants to merge 1 commit into
Conversation
New subcommand that runs SQL against a cloud service via the queries.clickhouse.cloud endpoint, reusing whatever credentials are already configured (API key or OAuth JWT). Unlike `cloud service client` this needs no local clickhouse binary and no password — the query endpoint authorizes via the cloud credential directly. Adds `authenticated_request` to the library client so the extra-host call can share auth with the main API without duplicating the creds. Refs #115 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Closing to restart the implementation cleanly \u2014 will reopen once rewritten. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #115. Stacked on #120 (
issue-48-debug-auth-source) — rebase/merge that first.New
clickhousectl cloud service querysubcommand that executes SQL against a cloud service over HTTP viaqueries.clickhouse.cloud, reusing whatever credentials are already configured. No localclickhousebinary and no service password required.--query/--queries-file/ stdin for SQL input--databaseselects the target database--formatoverrides output format (defaults toPrettyCompacton a TTY,TabSeparatedwhen piped)OAuth JWT works here the same as an API key (matches the sample curl in the issue), so the command is classified read-only for the OAuth write-gate — the SQL's own semantics are enforced on the ClickHouse side.
Library change
Adds
Client::authenticated_requestinclickhouse-cloud-apiso CloudClient can reuse the same auth/http for adjacent hosts. No generated-code changes.Not in this PR
Leaving
cloud service clientin place for now — issue 115 calls this out as a "much better approach" that eventually replaces it, but removal is a follow-up.Test plan
cargo test --workspacepasses (209 tests, +2 new forRunQueryRequestserialization)cargo buildclean,cargo clippyclean on changed cratescloud service query --helprenders and matches thefeedback_agent_context_helpmemory (CONTEXT FOR AGENTS adds non-obvious context only)cloud service query --name <svc> --query "SELECT 1"hits queries.clickhouse.cloud with OAuth JWT🤖 Generated with Claude Code