Skip to content

feat(query): Async query execution by returning early from long running queries#27

Merged
pthurlow merged 4 commits intomainfrom
feat/async-query
Mar 30, 2026
Merged

feat(query): Async query execution by returning early from long running queries#27
pthurlow merged 4 commits intomainfrom
feat/async-query

Conversation

@pthurlow
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Review

Issues

  • src/query.rs:136 — The "poll again" hint in poll() is missing the status subcommand. It prints hotdata query <id> but the correct invocation is hotdata query status <id>. The correct hint is already used in execute() at line 82. Following this bad hint would either fail to parse or attempt to run the query-run ID as SQL.

Action Required

Fix line 136: change "Poll again with: hotdata query {}" to "Poll again with: hotdata query status {}".

Comment thread src/query.rs
Comment thread src/query.rs
Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Review

Issues

P1 — src/query.rs:132–137: poll exits 0 when query is still running

The catch-all arm (statuses like "running" or "pending") prints to stderr and returns with exit code 0. This is indistinguishable from a successful result to any caller checking exit codes, making scripted polling impossible without parsing stderr output.

Fix: exit with a non-zero code (e.g. std::process::exit(2)) in the still-running arm so callers can loop on it reliably.

Action Required

Add a non-zero exit in the status => catch-all arm of poll before this can merge.

@pthurlow pthurlow merged commit 340c48f into main Mar 30, 2026
7 checks passed
@pthurlow pthurlow deleted the feat/async-query branch March 30, 2026 19:52
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