Skip to content

feat(cli): expose Postgres standby count (#1471) - #1480

Open
sdairs wants to merge 1 commit into
claude/drift-1466-cli-servicesfrom
claude/drift-1466-cli-postgres
Open

sdairs wants to merge 1 commit into
claude/drift-1466-cli-servicesfrom
claude/drift-1466-cli-postgres

Conversation

@sdairs

@sdairs sdairs commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #1471. CLI PR for the Postgres part of #1466, stacked on #1477.

  • cloud postgres create and update take --standby-count 0|1|2.
  • When --ha-type is also given, the pair is checked against it: none takes 0, async 1, sync 1 or 2. A mismatch is a usage error (exit 2) before any HTTP call; any other case is left to the API.
  • get shows a Standby count line and list a Standbys column. JSON already carries standbyCount.
  • A standby-count change is handled like an HA change: human output prints the background note, and JSON output has no next poll.
  • Tests:
    • clap parsing;
    • every valid and invalid combination in the check;
    • builders with minimal and maximal inputs;
    • the list-columns subprocess test, updated for the new column.
  • The managed Postgres guide and the automation reference are updated.

🤖 Generated with Claude Code


Note

Medium Risk
Changes managed Postgres HA topology (standby provisioning) via create/update, though client-side validation and broad test coverage limit misuse risk.

Overview
Adds --standby-count 0|1|2 to cloud postgres create and update, wiring it through to the API as standbyCount. When --ha-type is also set, the CLI rejects invalid pairings locally (none→0, async→1, sync→1 or 2) before any HTTP call; otherwise validation is left to the API.

get and list now surface standby count in human output (Standby count / Standbys column); JSON already exposed standbyCount. Updates that change HA type or standby count are treated like HA changes: no JSON next poll hint, and human mode prints the background-replication note. Docs and unit/integration tests cover parsing, validation, request builders, and list output.

Reviewed by Cursor Bugbot for commit 3a6ef70. Bugbot is set up for automated code reviews on this repo. Configure here.

@sdairs
sdairs requested a review from iskakaushik as a code owner November 17, 2026 15:41
Add `--standby-count 0|1|2` to `cloud postgres create` and `update`. When
`--ha-type` is also given, the count is checked against it before any
request (none takes 0, async 1, sync 1 or 2) and a mismatch is a usage
error (exit 2). A count without `--ha-type` is left to the API, which
checks it against the service's HA type.

`cloud postgres get` and `list` show the standby count in human output;
JSON already carried `standbyCount`. A standby-count change, like an HA
change, gets the background-change note and no `next` poll, since
`standbyCount` flips on acceptance.

Fixes #1471

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sdairs
sdairs force-pushed the claude/drift-1466-cli-postgres branch from 5d95fbc to 3a6ef70 Compare November 17, 2026 16:45
@sdairs
sdairs changed the base branch from claude/drift-1466-api-postgres to claude/drift-1466-cli-services November 17, 2026 16:45
@sdairs
sdairs added this pull request to stack #1483 November 17, 2026 16:46

This branch has not been deployed

No deployments
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.

CLI: expose Postgres standby count

1 participant