Repository navigation
feat(query): add query top to monitor running queries - #179
Merged
Merged
Conversation
List running queries with their details fetched in parallel: start time, elapsed time, progress, processed and estimated rows, compute size, worker, memory, disk, and client. `--sort` orders by elapsed|progress|rows|memory|disk; `--watch` (`-w`) redraws on the alternate screen every `--interval` seconds until Ctrl+C. The redraw loop lives in a reusable `ui/terminal/live-view.ts`, and table columns gain an optional `minWidth` so live views do not shift. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
utay
approved these changes
Nov 8, 2026
GitHub no longer supports the macos-14 runner image, so the job was cancelled before starting and failed the Required check on every run since Nov 5, main included. The release matrix already uses macos-15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Track GitHub's current macOS image, like windows-latest, so retiring an image no longer cancels the job. Release builds stay pinned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
redox
pushed a commit
that referenced
this pull request
Nov 8, 2026
🤖 I have created a release *beep* *boop* --- ## [1.15.0](v1.14.0...v1.15.0) (2026-11-08) ### Features * **query:** add `query top` to monitor running queries ([#179](#179)) ([81ed29e](81ed29e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: altertable-release[bot] <345426372+altertable-release[bot]@users.noreply.github.com>
Contributor
|
Verified npm archive integrity and the matching GitHub bundle SHA-256. The extracted package reports 1.15.0, returns the expected fixture-based Upgrade with |
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
altertable query top: callsGET /queries, thenGET /query/{id}for each running query in parallel (capped at 8 concurrent lookups), and shows start time, elapsed time, progress, processed / estimated rows (X / ~Y), compute size, worker, memory, disk, client, and the statement.-w/--watchredraws on the alternate screen every--intervalseconds (default 1, minimum 0.2) until Ctrl+C. When a refresh fails, the last good data stays on screen with the error above it, and rows are trimmed to the terminal height ("… N more").--sort elapsed|progress|rows|memory|disk(largest first, missing values last; defaultelapsed). It also applies to--json, which returns{ queries: [{ id, started_at, details }] }with the raw detail body.Implementation notes
toQueryTopRow. A negativepercentagemeans no estimate and shows-; rows show-when nothing has been scanned or estimated.DISKsumsworker.memory_by_tag[].temporary_storage_bytes. Summing that array'smemory_usage_bytesgives exactlyworker.memory_usage_bytes, soMEMuses that field directly.cli/src/ui/terminal/live-view.ts: a reusable full-screen refresh loop (alternate screen, Ctrl+C, in-place redraw, sleep that Ctrl+C cuts short).DisplayTableColumngains an optionalminWidthso the live view's columns keep their width as values change.Known limitations
sendHttpcan't be cancelled yet.QUERYcolumn is squeezed.Test plan
bun run check(full gate)altertable query top/--json/--sort rowsagainst an environment with running queries--watchunder a pseudo-terminal: redraws every second, Ctrl+C leaves the alternate screen and restores the cursorquery top -win a real terminal while a long query runs🤖 Generated with Claude Code