Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,14 @@ pscale dedicated-read-replica create <database> <branch> <name> --region <region
pscale dedicated-read-replica update <database> <branch> <name> --replicas 3 --org <org> --format json
pscale dedicated-read-replica update <database> <branch> <name> --cluster-size PS_20_GCP_X86 --parameters pgconf.max_connections=300 --org <org> --format json
pscale dedicated-read-replica delete <database> <branch> <name> --org <org> --format json --force
pscale dedicated-read-replica detach <database> <branch> <name> --org <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`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions internal/cmd/dedicatedreadreplica/detach.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down