From 2443d3058d0023165b0bc7fe41bc99a0612c27c2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 1 Dec 2026 17:22:49 +0000 Subject: [PATCH] Show dedicated read replica detach in help List detach in dedicated-read-replica help. Co-authored-by: Nick Holden --- AGENTS.md | 5 +++-- .../cmd/dedicatedreadreplica/dedicatedreadreplica_test.go | 8 -------- internal/cmd/dedicatedreadreplica/detach.go | 3 --- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7547c800..dfefb2f8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -665,13 +665,14 @@ pscale dedicated-read-replica create --region --replicas 3 --org --format json pscale dedicated-read-replica update --cluster-size PS_20_GCP_X86 --parameters pgconf.max_connections=300 --org --format json pscale dedicated-read-replica delete --org --format json --force +pscale dedicated-read-replica detach --org --format json --force ``` - `create` requires a name and `--region`. The API defaults to one instance and the primary cluster size when `--replicas` and `--cluster-size` are omitted. -- `show`, `update`, and `delete` identify the dedicated read replica by name. +- `show`, `update`, `delete`, and `detach` identify the dedicated read replica by name. - `update` requires at least one of `--replicas`, `--cluster-size`, or repeatable `--parameters namespace.name=value`. Parameter values must be greater than or equal to the primary's corresponding values. - Creating and updating dedicated read replicas is asynchronous; inspect `state` and `ready` in the returned object or with `list`. -- `delete` requires explicit approval before using `--force`. +- `delete` and `detach` require explicit approval before using `--force`. - `read-only-replica` remains available as a backwards-compatible command alias. It prints a deprecation warning on stderr; stdout is unchanged. - PostgreSQL only. For Vitess/MySQL, use `pscale keyspace read-only-regions`. diff --git a/internal/cmd/dedicatedreadreplica/dedicatedreadreplica_test.go b/internal/cmd/dedicatedreadreplica/dedicatedreadreplica_test.go index 42678086..4d57e85f 100644 --- a/internal/cmd/dedicatedreadreplica/dedicatedreadreplica_test.go +++ b/internal/cmd/dedicatedreadreplica/dedicatedreadreplica_test.go @@ -293,14 +293,6 @@ func TestDetachCmd(t *testing.T) { c.Assert(buf.String(), qt.JSONEquals, detached) } -func TestDetachCmdIsHidden(t *testing.T) { - c := qt.New(t) - - cmd := DetachCmd(&cmdutil.Helper{Config: &config.Config{}}) - - c.Assert(cmd.Hidden, qt.IsTrue) -} - func TestDetachCmdRequiresForceInJSON(t *testing.T) { c := qt.New(t) org, database := "planetscale", "mydb" diff --git a/internal/cmd/dedicatedreadreplica/detach.go b/internal/cmd/dedicatedreadreplica/detach.go index 7311ece3..3b2c8a58 100644 --- a/internal/cmd/dedicatedreadreplica/detach.go +++ b/internal/cmd/dedicatedreadreplica/detach.go @@ -31,9 +31,6 @@ PgBouncers attached to it must be deleted first. This command is only available for PostgreSQL databases.`, Args: cmdutil.RequiredArgs("database", "branch", "name"), - // Detachment is behind a feature flag on the API. Keep the command out - // of help output until it is generally available. - Hidden: true, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() database, sourceBranch, name := args[0], args[1], args[2]