From f568fed8e92fda00579d72e637bdfc211478a07c Mon Sep 17 00:00:00 2001 From: Zac Farrell Date: Fri, 5 Jun 2026 10:35:20 -0700 Subject: [PATCH] feat(query): remove dead --connection flag --- README.md | 4 ++-- skills/hotdata-analytics/SKILL.md | 2 +- skills/hotdata/SKILL.md | 2 +- src/command.rs | 4 ---- src/main.rs | 13 ++++--------- src/query.rs | 13 +------------ 6 files changed, 9 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 20dfb24..9aa6f2c 100644 --- a/README.md +++ b/README.md @@ -216,12 +216,12 @@ hotdata context push [-w ] [--dry-run] ## Query ```sh -hotdata query "" [-w ] [--connection ] [-o table|json|csv] +hotdata query "" [-w ] [-d ] [-o table|json|csv] hotdata query status [-o table|json|csv] ``` - Default output is `table`, which prints results with row count and execution time. -- Use `--connection` to scope the query to a specific connection. +- Use `-d`/`--database` to run the query against a specific managed database. - Long-running queries automatically fall back to async execution and return a `query_run_id`. - Use `hotdata query status ` to poll for results. - Exit codes for `query status`: `0` = succeeded, `1` = failed, `2` = still running (poll again). diff --git a/skills/hotdata-analytics/SKILL.md b/skills/hotdata-analytics/SKILL.md index 958c6e0..b75408f 100644 --- a/skills/hotdata-analytics/SKILL.md +++ b/skills/hotdata-analytics/SKILL.md @@ -17,7 +17,7 @@ version: 0.4.0 ## Execute SQL ```bash -hotdata query "" [--workspace-id ] [--connection ] [--output table|json|csv] +hotdata query "" [--workspace-id ] [--database ] [--output table|json|csv] hotdata query status [--output table|json|csv] ``` diff --git a/skills/hotdata/SKILL.md b/skills/hotdata/SKILL.md index bf82383..13b4aee 100644 --- a/skills/hotdata/SKILL.md +++ b/skills/hotdata/SKILL.md @@ -315,7 +315,7 @@ hotdata context push [--database-id ] [--dry-run] ### Execute SQL Query ``` -hotdata query "" [--workspace-id ] [--connection ] [--output table|json|csv] +hotdata query "" [--workspace-id ] [--database ] [--output table|json|csv] hotdata query status [--output table|json|csv] ``` diff --git a/src/command.rs b/src/command.rs index aeff0a2..7fb45e7 100644 --- a/src/command.rs +++ b/src/command.rs @@ -34,10 +34,6 @@ pub enum Commands { #[arg(long, short = 'w')] workspace_id: Option, - /// Scope query to a specific connection - #[arg(long)] - connection: Option, - /// Run query against a specific managed database (overrides the current database set via `databases set`) #[arg(long, short = 'd')] database: Option, diff --git a/src/main.rs b/src/main.rs index 5b54dad..ec0e5b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -274,7 +274,6 @@ fn main() { Commands::Query { sql, workspace_id, - connection, database, output, command, @@ -283,13 +282,9 @@ fn main() { match command { Some(QueryCommands::Status { id }) => query::poll(&id, &workspace_id, &output), None => match sql { - Some(sql) => query::execute( - &sql, - &workspace_id, - connection.as_deref(), - database.as_deref(), - &output, - ), + Some(sql) => { + query::execute(&sql, &workspace_id, database.as_deref(), &output) + } None => { use clap::CommandFactory; let mut cmd = Cli::command(); @@ -912,7 +907,7 @@ fn main() { ), _ => unreachable!(), }; - query::execute(&sql, &workspace_id, None, None, &output) + query::execute(&sql, &workspace_id, None, &output) } Commands::Queries { id, diff --git a/src/query.rs b/src/query.rs index 2402119..8e2a737 100644 --- a/src/query.rs +++ b/src/query.rs @@ -230,20 +230,9 @@ pub(crate) fn fetch_arrow_result(api: &Api, result_id: &str) -> QueryResponse { arrow_ipc_to_query_response(bytes, result_id.to_owned()) } -pub fn execute( - sql: &str, - workspace_id: &str, - connection: Option<&str>, - database: Option<&str>, - format: &str, -) { +pub fn execute(sql: &str, workspace_id: &str, database: Option<&str>, format: &str) { let api = Api::new(Some(workspace_id)); - // `--connection` is a no-op: /query is database-scoped and the endpoint has - // no connection_id field. Accepted for compatibility (see follow-up issue - // to remove it). - let _ = connection; - // Scope to the explicit --database flag, else the active database resolved // at construction (HOTDATA_DATABASE / current database). submit_query sends // it as the X-Database-Id header.