MCPcopy Create free account
hub / github.com/Scalingo/cli / GetCurrentDatabase

Function GetCurrentDatabase

detect/app.go:75–86  ·  view source on GitHub ↗

GetCurrentDatabase is a helper to get the current database name and UUID.

(ctx context.Context, c *cli.Command)

Source from the content-addressed store, hash-verified

73
74// GetCurrentDatabase is a helper to get the current database name and UUID.
75func GetCurrentDatabase(ctx context.Context, c *cli.Command) (string, string) {
76 currentDatabase, databaseUUID, err := currentDatabaseNameAndUUID(ctx, c)
77 if errors.Is(err, errDatabaseNotFound) {
78 io.Error("No database found. Please use --database flag.")
79 os.Exit(1)
80 }
81 if err != nil {
82 io.Error(err)
83 os.Exit(1)
84 }
85 return currentDatabase, databaseUUID
86}
87
88// GetCurrentResource is the new helper to get the current resource (app or database).
89func GetCurrentResource(ctx context.Context, c *cli.Command) string {

Callers 3

databases_ng.goFile · 0.92
firewall_rules.goFile · 0.92
GetDatabaseFromArgsFunction · 0.85

Calls 2

ErrorFunction · 0.92

Tested by

no test coverage detected