feat(context): scope context commands to active database#98
Merged
Conversation
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.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
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 namedatabase_id, nolong = "..."override, noinfer_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).
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.
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
/databases/{database_id}/contextinstead of/context--database/-dflag tohotdata context; falls back to the active database set viahotdata databases set--databaseflag is passedRequires
hotdata-dev/runtimedb#474 — which implements the
/databases/{database_id}/contextendpoints and migrates storage fromworkspace_contextstodatabase_contexts.