Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Add database-cluster:start and database-cluster:stop - #306

Closed
joetannenbaum wants to merge 1 commit into
mainfrom
api-sync/database-clusters
Closed

joetannenbaum wants to merge 1 commit into
mainfrom
api-sync/database-clusters

Conversation

@joetannenbaum

@joetannenbaum joetannenbaum commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Adds database-cluster:start and database-cluster:stop for the two database cluster endpoints in the current API spec that the CLI didn't cover.

Findings

Endpoint Spec CLI before
POST /databases/clusters/{database}/start Starts a stopped Laravel MySQL or Serverless Postgres cluster; answers 200 with DatabaseResource. A Serverless Postgres cluster gets a new hostname when it starts, so connected environments need a redeploy. No request class or command
POST /databases/clusters/{database}/stop Stops a Laravel MySQL or Serverless Postgres cluster. Its data is kept, but environments can't connect until it's started again; answers 200 with DatabaseResource. No request class or command

Neither takes a request body. Both need the database_cluster.edit permission.

The start description mentions data.meta.redeploy_required, but DatabaseResource declares no meta, so the command doesn't read it. It checks the cluster's type (neon_serverless_postgres) instead.

Changes

  • StartDatabaseClusterRequest / StopDatabaseClusterRequest, plus start() and stop() on DatabaseClustersResource.
  • database-cluster:start {cluster?} and database-cluster:stop {cluster?} {--force}, aliased db-cluster:start / db-cluster:stop like the other cluster commands. They resolve the cluster the way database-cluster:get does (ID or name, picker when interactive) and print the returned cluster with --json, using the same DatabaseCluster DTO.
  • After starting a Serverless Postgres cluster, a person sees a warning to redeploy connected environments. It isn't part of the --json output.
  • Stopping cuts environments off from the cluster, so database-cluster:stop goes through confirmDestructive() and needs --force when non-interactive. database-cluster:start doesn't confirm.
  • README command table, with a note on stop and the Postgres redeploy, and the client README request list.

Tests

tests/Feature/DatabaseClusterStartStopTest.php covers the request each command sends, the --json shape, the redeploy warning (shown for Serverless Postgres, not for MySQL, never in JSON), and that database-cluster:stop refuses to run headlessly without --force. The full suite (PromptFallbackTest skipped locally), PHPStan and Pint pass, re-run after rebasing on the current main.

Demo

This session could not embed the GIFs inline: image markdown was stripped on its way to GitHub, so they are plain links. Add a ! before each to make it play inline.

cloud database-cluster:start

database-cluster:start with no argument: pick a cluster; starting a Serverless Postgres cluster ends with the redeploy warning.

cloud database-cluster:stop

database-cluster:stop with no argument: pick a cluster, confirm, then it stops.


Generated by Claude Code

The API can now start and stop a Laravel MySQL or Serverless Postgres
database cluster (POST /databases/clusters/{database}/start and /stop).
Both commands resolve the cluster like database-cluster:get and output
the updated cluster with --json. Stopping cuts environments off from the
cluster, so database-cluster:stop confirms and needs --force when
non-interactive.

A Serverless Postgres cluster comes back on a new hostname, so after
starting one, database-cluster:start tells a person to redeploy the
environments connected to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Y2hkEm7aPHvpU9eP2
@joetannenbaum
joetannenbaum force-pushed the api-sync/database-clusters branch from 5a89d60 to 1cac7f3 Compare November 25, 2026 18:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants