Skip to content

Fix piped SQL output and document row limit - #127

Merged
nitisht merged 1 commit into
parseablehq:mainfrom
pratik50:fix/sql-spinner-piped-output
Oct 3, 2026
Merged

nitisht merged 1 commit into
parseablehq:mainfrom
pratik50:fix/sql-spinner-piped-output

Conversation

@pratik50

@pratik50 pratik50 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #118 and #117

  • Show the SQL/PromQL fetch spinner only when stderr is a terminal, keeping piped JSON clean.
  • Document the default 500-row SQL limit and explicit LIMIT behavior in help, the agent catalog, and README.

Summary by CodeRabbit

  • Documentation

    • Clarified that SQL queries without an explicit LIMIT return up to 500 rows. JSON output does not fetch additional pages, while interactive mode fetches results in 500-row windows up to the SQL limit.
    • Documented that explicit SQL limits are not capped by the command, and recommended choosing a reasonable limit to avoid large JSON responses.
  • Bug Fixes

    • Spinner animations no longer appear when command output is redirected or otherwise not attached to a terminal.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: be63ad76-fcda-474f-a7a0-23468591ad46

📥 Commits

Reviewing files that changed from the base of the PR and between 25493c9 and 09fbcfe.

📒 Files selected for processing (3)
  • README.md
  • cmd/agent.go
  • cmd/query.go

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The SQL documentation and command descriptions clarify result limits and pagination. The command also suppresses spinner output when stderr is not a terminal.

Changes

SQL command behavior and guidance

Layer / File(s) Summary
SQL result-limit guidance
README.md, cmd/agent.go, cmd/query.go
Documentation and command descriptions state that queries without an explicit SQL LIMIT return at most 500 rows. They describe JSON and interactive pagination, and clarify that pb does not cap an explicit SQL limit.
Terminal-aware spinner
cmd/query.go
When stderr is not a terminal, startSpinner returns a no-op stop function. Terminal stderr continues to use the existing animation.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 09fbc

The change suppresses spinner output in merged pipes and clarifies SQL row limits. No actionable merge-blocking risk remains in the supplied evidence.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR adds row-limit documentation in README.md, cmd/agent.go, and cmd/query.go. These changes do not implement or support the spinner fix in #118. The supplied linked-issue evidence contains n… Remove the row-limit documentation changes from this PR, or provide an active directly linked issue record that requires them.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both primary changes: preventing spinner output in piped SQL output and documenting the SQL row limit.
Linked Issues check ✅ Passed For #118, cmd/query.go checks term.IsTerminal(int(os.Stderr.Fd())) before starting the spinner. When stderr is not a terminal, startSpinner returns a no-op function and writes no spinner charact…
Full details: Out of Scope Changes check

Explanation

The PR adds row-limit documentation in README.md, cmd/agent.go, and cmd/query.go. These changes do not implement or support the spinner fix in #118. The supplied linked-issue evidence contains no active issue record for #117; the PR summary's reference to #117 does not establish its coding scope.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@nitisht
nitisht self-requested a review October 3, 2026 16:43
@nitisht
nitisht merged commit e92e08a into parseablehq:main Oct 3, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress spinner is written to stderr when not on a TTY, which breaks 2>&1 | jq

2 participants