feat(app): add commands to link, unlink and replace an app's database#1971
Open
martin-helmich wants to merge 3 commits into
Open
feat(app): add commands to link, unlink and replace an app's database#1971martin-helmich wants to merge 3 commits into
martin-helmich wants to merge 3 commits into
Conversation
Adds `mw app database link | unlink | replace` so managing an app installation's linked database no longer requires calling the raw HTTP API. - `link` wraps the `app-link-database` operation and always sends `databaseUserIds.admin`, which the API requires in practice. - `unlink` wraps `app-unlink-database`. - `replace` wraps `app-replace-database`. Closes #1969 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The app database commands no longer require full database UUIDs: - link/replace now accept a database name (resolved against the project's MySQL and Redis databases) in addition to a UUID. - unlink and replace determine the currently linked database from the app installation automatically, so the old database ID no longer has to be supplied. An optional --purpose flag disambiguates when several databases are linked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Managing an app installation's linked database (link / unlink / replace) was previously only possible via the raw HTTP API. This adds dedicated
mwsubcommands under a newapp databasecommand group.Commands added
mw app database link <installation-id> --database-id <id> [--purpose primary|cache|custom] --admin-user-id <id>Wraps the
app-link-databaseoperation (apiClient.app.linkDatabase). Always includesdatabaseUserIds.adminin the payload, since the API rejects the call without it even though the schema only marksdatabaseIdandpurposeas required.mw app database unlink <installation-id> --database-id <id>Wraps
app-unlink-database(apiClient.app.unlinkDatabase). Built onDeleteBaseCommand, so it asks for confirmation (skippable via-f/--force).mw app database replace <installation-id> --old-database-id <id> --new-database-id <id> --admin-user-id <id>Wraps
app-replace-database(apiClient.app.replaceDatabase).The "set database users" operation was left out for now as it is lower priority.
Notes
installation-id), consistent withmw app uninstall, and supports short IDs (a-XXXXXX) and CLI context.--purposedefaults toprimary.databaseUserIDsvsdatabaseUserIdscasing bug mentioned in the issue is an API-side concern and is out of scope here.Closes #1969
🤖 Generated with Claude Code