Skip to content

Add --min-storage and --max-storage flags to database and branch creation#1246

Merged
nholden merged 2 commits intomainfrom
nick/storage-flags
Apr 7, 2026
Merged

Add --min-storage and --max-storage flags to database and branch creation#1246
nholden merged 2 commits intomainfrom
nick/storage-flags

Conversation

@nholden
Copy link
Copy Markdown
Member

@nholden nholden commented Apr 7, 2026

Summary

Users running automated import workflows need to configure storage size at database creation time. Without this, they have to create a database with the default minimum storage and immediately resize — often hitting storage limits before the resize takes effect (planetscale/surfaces#3485).

The API now supports storage configuration at creation time (planetscale/api-bb#18339, planetscale/api-bb#18389), and the SDK has been updated to match (planetscale/planetscale-go#303). This PR exposes those parameters in the CLI.

Usage

# Create a PostgreSQL database with storage configuration
pscale database create mydb --engine postgresql --min-storage 10737418240 --max-storage 107374182400

# Create a branch with storage configuration
pscale branch create mydb mybranch --min-storage 10737418240 --max-storage 107374182400

Flags accept bytes, consistent with existing CLI conventions (e.g., --max-query-size). Storage flags are only supported for PostgreSQL — the CLI returns a clear error if used with a MySQL database or branch.

Blocked on: a new release of planetscale-go after planetscale/planetscale-go#303 is merged. go.mod will need to be updated to the new version before this can pass CI.

Test plan

  • TestDatabase_CreateCmdWithStorage
  • TestDatabase_CreateCmdWithStorageMySQLError
  • TestBranch_CreateCmdWithStorage
  • TestBranch_CreateCmdWithStorageMySQLError
  • Manually verified: created a PostgreSQL database and branch with storage flags
  • Manually verified: MySQL database and branch creation correctly rejected

🤖 Generated with Claude Code

…tion

Allow users to configure minimum and maximum storage size (in bytes)
when creating PostgreSQL databases and branches. Returns a clear error
if used with MySQL databases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nholden nholden marked this pull request as ready for review April 7, 2026 17:45
@nholden nholden requested a review from a team as a code owner April 7, 2026 17:45
@nholden nholden self-assigned this Apr 7, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nholden nholden merged commit 09b8752 into main Apr 7, 2026
4 checks passed
@nholden nholden deleted the nick/storage-flags branch April 7, 2026 18:04
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.

2 participants