Skip to content

feat: add spinner to db query command (closes #63) - #65

Merged
TrivCodez merged 2 commits into
IN3PIRE:mainfrom
SankeerthNara:Add-spinner
Jul 22, 2026
Merged

TrivCodez merged 2 commits into
IN3PIRE:mainfrom
SankeerthNara:Add-spinner

Conversation

@SankeerthNara

Copy link
Copy Markdown
Contributor

Add spinner/loading indicator to db query

Closes #63

Summary

db query previously gave no visual feedback while the query was executing, which was confusing for long-running queries. This adds an ora spinner that runs while the query executes.

Changes

  • Added static import ora from "ora" (matches the pattern already used in endpoint.ts, since ora is already a dependency)
  • Spinner starts right before the query runs, showing "Running query…"
  • Spinner stops cleanly before results are printed (both JSON and table output)
  • Spinner is also stopped in the catch block, so it doesn't hang on connection or query errors

Testing

  • npm run build passes with no TypeScript errors
  • Verified the spinner animates and stops correctly using a local test harness with the same ora start/stop pattern used in the real fix

Demo

Recording.2026-07-22.144057.mp4

Acceptance criteria

  • db query <branch> "SELECT 1" shows a spinner while executing
  • Spinner stops before results are displayed
  • Spinner stops properly on error
  • npm run build passes with no errors

@TrivCodez TrivCodez 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.

Hey @SankeerthNara, nice work on this! Really clean PR overall — appreciate you jumping on this so quickly after being assigned.

What stood out to me:

  • You went with the static import for , which is exactly what the issue suggested and keeps things consistent with — solid choice.
  • The spinner scoping is spot on. Declaring it outside the try so it's accessible in the catch block, and using spinner?.stop() with optional chaining so it doesn't blow up if the error happens before the spinner is even created — those little details show good instincts.
  • It starts after all the connection setup, so the spinner only covers the actual query execution. That's the right call UX-wise.
  • Both output paths (JSON and table) stop the spinner cleanly before printing results.

One tiny thing I noticed:
The file lost its trailing newline at the end (the diff shows \ No newline at end of file). It's a super minor thing — GitHub usually flags it and most editors auto-fix it anyway — but worth keeping an eye on for consistency with the rest of the codebase.

That's really it. The logic is correct, it follows the patterns already established in the project, and it closes out the issue properly. Solid first contribution — hope to see more from you!

Let me know if you have any questions or want me to take another pass after the newline fix.

@TrivCodez TrivCodez 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.

Hey @SankeerthNara, nice work on this! Really clean PR overall — appreciate you jumping on this so quickly after being assigned.

What stood out to me:

  • You went with the static import for ora, which is exactly what the issue suggested and keeps things consistent with endpoint.ts — solid choice.
  • The spinner scoping is spot on. Declaring it outside the try so it's accessible in the catch block, and using spinner?.stop() with optional chaining so it doesn't blow up if the error happens before the spinner is even created — those little details show good instincts.
  • It starts after all the connection setup, so the spinner only covers the actual query execution. That's the right call UX-wise.
  • Both output paths (JSON and table) stop the spinner cleanly before printing results.

One tiny thing I noticed:
The file lost its trailing newline at the end (the diff shows \ No newline at end of file). It's a super minor thing — GitHub usually flags it and most editors auto-fix it anyway — but worth keeping an eye on for consistency with the rest of the codebase.

That's really it. The logic is correct, it follows the patterns already established in the project, and it closes out the issue properly. Solid first contribution — hope to see more from you!

Let me know if you have any questions or want me to take another pass after the newline fix.

@SankeerthNara

Copy link
Copy Markdown
Contributor Author

Thanks for pointing out my mistake and rectifying
Looking forward to help you out
Please notify me for any more rectifications

@TrivCodez

Copy link
Copy Markdown
Contributor

No worries at all — we all miss those little things from time to time. The spinner implementation itself was solid, just needed that trailing newline polish.

Appreciate you being open to feedback and jumping in so quickly. If you're up for it, issues #60, #61, and #62 are similar in scope and also assigned to you — they'd be great next steps if you're looking for more.

Happy to review whenever you're ready! 🚀

@TrivCodez
TrivCodez merged commit 5969259 into IN3PIRE:main Jul 22, 2026
2 checks passed
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.

Add spinner/loading indicator to db query

2 participants