From 8aa985c86fc81b10c246f8545edd30f08fc3862c Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:30:39 -0700 Subject: [PATCH] Show group unarchive command when db unarchive fails When a database belongs to a group, the unarchive error now includes the specific command to unarchive the group, e.g.: turso group unarchive The database's group is looked up automatically. If the lookup fails, a generic placeholder is shown instead. Fixes #918 --- internal/cmd/db_wakeup.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/cmd/db_wakeup.go b/internal/cmd/db_wakeup.go index ed152735..95b1a1f2 100644 --- a/internal/cmd/db_wakeup.go +++ b/internal/cmd/db_wakeup.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "strings" "time" "github.com/spf13/cobra" @@ -38,6 +39,13 @@ func wakeupDatabase(client *turso.Client, name string) error { defer s.Stop() if err := client.Databases.Wakeup(name); err != nil { + if strings.Contains(err.Error(), "part of a group") { + db, dbErr := getDatabase(client, name) + if dbErr != nil { + return fmt.Errorf("%w\n\nTo unarchive the group, run:\n\n\tturso group unarchive ", err) + } + return fmt.Errorf("%w\n\nTo unarchive the group, run:\n\n\tturso group unarchive %s", err, db.Group) + } return err } s.Stop()