Skip to content

feat(context): scope context commands to active database#98

Merged
eddietejeda merged 3 commits into
mainfrom
feat/database-context
May 23, 2026
Merged

feat(context): scope context commands to active database#98
eddietejeda merged 3 commits into
mainfrom
feat/database-context

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

  • Context commands now call /databases/{database_id}/context instead of /context
  • Adds --database / -d flag to hotdata context; falls back to the active database set via hotdata databases set
  • Exits with a clear error if no database is active and no --database flag is passed
  • Error messages updated from "workspace" to "database" throughout

Requires

hotdata-dev/runtimedb#474 — which implements the /databases/{database_id}/context endpoints and migrates storage from workspace_contexts to database_contexts.

Context commands now call /v1/databases/{database_id}/context instead
of /v1/context. A --database / -d flag is added to the context command;
when omitted it falls back to the active database set via
'hotdata databases set'. Exits with a clear error if no database is active.

Paired with hotdata-dev/runtimedb#474.
@sentry
Copy link
Copy Markdown

sentry Bot commented May 23, 2026

Codecov Report

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

Files with missing lines Patch % Lines
src/context.rs 0.00% 14 Missing ⚠️
src/main.rs 0.00% 11 Missing ⚠️
src/datasets.rs 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/main.rs Outdated
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Review

Blocking Issues

  • src/main.rs:950 — the "no active database" error tells the user to pass --database, but the flag clap actually exposes is --database-id (field name database_id, no long = "..." override, no infer_long_args). Following the suggestion as-printed produces an "unexpected argument" error.

Action Required

Either rename the flag to --database via #[arg(long = "database", ...)] in src/command.rs:238 (matches the PR description), or update the error message in src/main.rs:950 to say --database-id (matches the existing --workspace-id convention).

claude[bot]
claude Bot previously approved these changes May 23, 2026
The DatasetSource schema is a tagged union requiring a 'type' field.
Without it the API rejects both create-from-query and
create-from-saved-query with a deserialization error.
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Prior blocking issue (error message vs flag mismatch) resolved — error text now matches --database-id.

@eddietejeda eddietejeda merged commit c8bd3a4 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