Skip to content

feat(query): expose scanned bytes/rows and surface query_run_id - #236

Merged
zfarrell merged 4 commits into
mainfrom
worktree-mutable-riding-hamming
Jul 20, 2026
Merged

feat(query): expose scanned bytes/rows and surface query_run_id#236
zfarrell merged 4 commits into
mainfrom
worktree-mutable-riding-hamming

Conversation

@zfarrell

@zfarrell zfarrell commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Expose bytes_scanned/rows_scanned from the query-run history API in hotdata queries, and surface query_run_id in hotdata query output (footer + JSON) so the run lookup is actually reachable. The query JSON body now serializes the response struct directly.

BREAKING CHANGE: hotdata query --output json no longer emits preview_row_count (use row_count), and the warning field is now stderr-only rather than in the JSON body.

@zfarrell
zfarrell requested a review from a team as a code owner July 20, 2026 23:32
@zfarrell
zfarrell requested review from eddietejeda and removed request for a team July 20, 2026 23:32
Comment thread src/commands/query.rs
);
// Serialize the display struct directly; `warning` is `#[serde(skip)]`
// (stderr-only), the rest is the JSON body.
println!("{}", serde_json::to_string_pretty(result).unwrap());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: (not blocking) Serializing the struct directly drops the preview_row_count field the old result_json emitted, so this is a backward-incompatible change to the --output json shape. The value is still recoverable from row_count (they were always equal), but any consumer reading preview_row_count will now get undefined. Worth confirming this is intended and noting it in the changelog / release notes if the JSON output is a public contract.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. One non-blocking note left inline about the removed preview_row_count field in the --output json shape. Otherwise the changes are consistent with existing patterns (double-option flatten + clamp, warning stays stderr-only) and well covered by tests.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.14286% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/commands/query.rs 84.90% 8 Missing ⚠️
src/commands/queries.rs 83.33% 6 Missing ⚠️
src/commands/usage.rs 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zfarrell
zfarrell merged commit 85c9396 into main Jul 20, 2026
14 checks passed
@zfarrell
zfarrell deleted the worktree-mutable-riding-hamming branch July 20, 2026 23:41
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