Skip to content

feat(query): add --database flag and improve post-load UX#102

Merged
eddietejeda merged 1 commit into
mainfrom
feat/query-database-flag
May 23, 2026
Merged

feat(query): add --database flag and improve post-load UX#102
eddietejeda merged 1 commit into
mainfrom
feat/query-database-flag

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

@eddietejeda eddietejeda commented May 23, 2026

Summary

  • Adds `--database` / `-d` flag to `hotdata query` so a managed database can be scoped per-query without running `databases set` first
  • Adds `ApiClient::with_database()` builder method to override the `X-Database-Id` header for a single request without touching config
  • After `databases create` (table output), prints a ready-to-run example with the correct `databases load` dot-notation syntax, the `--database ` flag, and the `default..` SQL prefix
  • After `databases load`, prints a ready-to-run `hotdata query` command and a tip that uppercase column names require double-quoting
  • Test plan

    • `hotdata query --database <db_id> "SELECT * FROM default.public.
    LIMIT 10"` works without `databases set`
  • `--database` overrides a previously set current database
  • `hotdata databases create` table output shows correct `databases load` and `query --database` examples
  • `hotdata databases load` output shows correct `hotdata query` example with case-sensitivity tip
  • All existing unit tests pass (`cargo test`) — 165 pass; 3 pre-existing config env failures unrelated to this PR
  • 🤖 Generated with Claude Code

Add --database / -d flag to `hotdata query` so users can scope a query
to a specific managed database without permanently changing config via
`databases set`. Adds ApiClient::with_database() builder to override the
X-Database-Id header for a single request.

After `databases create` and `databases load` succeed, print ready-to-run
examples showing the correct `--database <id>` flag, `default.<schema>.<table>`
SQL prefix, and a reminder that uppercase column names need double-quoting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query.rs 0.00% 11 Missing ⚠️
src/databases.rs 0.00% 9 Missing ⚠️
src/main.rs 0.00% 8 Missing ⚠️
src/api.rs 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@eddietejeda eddietejeda merged commit da60348 into main May 23, 2026
11 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.

1 participant