Skip to content

Show group unarchive command when db unarchive fails#1026

Open
mvanhorn wants to merge 1 commit into
tursodatabase:mainfrom
mvanhorn:osc/918-unarchive-group-hint
Open

Show group unarchive command when db unarchive fails#1026
mvanhorn wants to merge 1 commit into
tursodatabase:mainfrom
mvanhorn:osc/918-unarchive-group-hint

Conversation

@mvanhorn
Copy link
Copy Markdown

Summary

When trying to unarchive a database that belongs to a group, the CLI now shows the exact command needed to unarchive the group. Previously the error told users to "unarchive the group instead" without specifying how.

Changes

Modified wakeupDatabase() in internal/cmd/db_wakeup.go to detect the "part of a group" error from the API, look up the database's group name via getDatabase(), and append an actionable hint:

Error: database charmed-rat-king is part of a group, please unarchive the group instead

To unarchive the group, run:

	turso group unarchive <actual-group-name>

If the group lookup fails, a generic <group-name> placeholder is shown instead.

Testing

  • go build ./... passes
  • go vet ./... passes

Fixes #918

This contribution was developed with AI assistance (Claude Code).

When a database belongs to a group, the unarchive error now includes
the specific command to unarchive the group, e.g.:

  turso group unarchive <group-name>

The database's group is looked up automatically. If the lookup fails,
a generic placeholder is shown instead.

Fixes tursodatabase#918
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.

Show the command to unarchive group when a user tries to unarchive a db

1 participant