Skip to content

Commit f568fed

Browse files
committed
feat(query): remove dead --connection flag
1 parent f7e5766 commit f568fed

6 files changed

Lines changed: 9 additions & 29 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ hotdata context push <name> [-w <id>] [--dry-run]
216216
## Query
217217

218218
```sh
219-
hotdata query "<sql>" [-w <id>] [--connection <connection_id>] [-o table|json|csv]
219+
hotdata query "<sql>" [-w <id>] [-d <database>] [-o table|json|csv]
220220
hotdata query status <query_run_id> [-o table|json|csv]
221221
```
222222

223223
- Default output is `table`, which prints results with row count and execution time.
224-
- Use `--connection` to scope the query to a specific connection.
224+
- Use `-d`/`--database` to run the query against a specific managed database.
225225
- Long-running queries automatically fall back to async execution and return a `query_run_id`.
226226
- Use `hotdata query status <query_run_id>` to poll for results.
227227
- Exit codes for `query status`: `0` = succeeded, `1` = failed, `2` = still running (poll again).

skills/hotdata-analytics/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ version: 0.4.0
1717
## Execute SQL
1818

1919
```bash
20-
hotdata query "<sql>" [--workspace-id <workspace_id>] [--connection <connection_id>] [--output table|json|csv]
20+
hotdata query "<sql>" [--workspace-id <workspace_id>] [--database <database>] [--output table|json|csv]
2121
hotdata query status <query_run_id> [--output table|json|csv]
2222
```
2323

skills/hotdata/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ hotdata context push <name> [--database-id <id>] [--dry-run]
315315
### Execute SQL Query
316316

317317
```
318-
hotdata query "<sql>" [--workspace-id <workspace_id>] [--connection <connection_id>] [--output table|json|csv]
318+
hotdata query "<sql>" [--workspace-id <workspace_id>] [--database <database>] [--output table|json|csv]
319319
hotdata query status <query_run_id> [--output table|json|csv]
320320
```
321321

src/command.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ pub enum Commands {
3434
#[arg(long, short = 'w')]
3535
workspace_id: Option<String>,
3636

37-
/// Scope query to a specific connection
38-
#[arg(long)]
39-
connection: Option<String>,
40-
4137
/// Run query against a specific managed database (overrides the current database set via `databases set`)
4238
#[arg(long, short = 'd')]
4339
database: Option<String>,

src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ fn main() {
274274
Commands::Query {
275275
sql,
276276
workspace_id,
277-
connection,
278277
database,
279278
output,
280279
command,
@@ -283,13 +282,9 @@ fn main() {
283282
match command {
284283
Some(QueryCommands::Status { id }) => query::poll(&id, &workspace_id, &output),
285284
None => match sql {
286-
Some(sql) => query::execute(
287-
&sql,
288-
&workspace_id,
289-
connection.as_deref(),
290-
database.as_deref(),
291-
&output,
292-
),
285+
Some(sql) => {
286+
query::execute(&sql, &workspace_id, database.as_deref(), &output)
287+
}
293288
None => {
294289
use clap::CommandFactory;
295290
let mut cmd = Cli::command();
@@ -912,7 +907,7 @@ fn main() {
912907
),
913908
_ => unreachable!(),
914909
};
915-
query::execute(&sql, &workspace_id, None, None, &output)
910+
query::execute(&sql, &workspace_id, None, &output)
916911
}
917912
Commands::Queries {
918913
id,

src/query.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,9 @@ pub(crate) fn fetch_arrow_result(api: &Api, result_id: &str) -> QueryResponse {
230230
arrow_ipc_to_query_response(bytes, result_id.to_owned())
231231
}
232232

233-
pub fn execute(
234-
sql: &str,
235-
workspace_id: &str,
236-
connection: Option<&str>,
237-
database: Option<&str>,
238-
format: &str,
239-
) {
233+
pub fn execute(sql: &str, workspace_id: &str, database: Option<&str>, format: &str) {
240234
let api = Api::new(Some(workspace_id));
241235

242-
// `--connection` is a no-op: /query is database-scoped and the endpoint has
243-
// no connection_id field. Accepted for compatibility (see follow-up issue
244-
// to remove it).
245-
let _ = connection;
246-
247236
// Scope to the explicit --database flag, else the active database resolved
248237
// at construction (HOTDATA_DATABASE / current database). submit_query sends
249238
// it as the X-Database-Id header.

0 commit comments

Comments
 (0)