Skip to content

keyspace create: add repeatable --custom-shard flag - #1484

Open
maxenglander wants to merge 2 commits into
mainfrom
cursor/keyspace-create-custom-shards-93ca
Open

maxenglander wants to merge 2 commits into
mainfrom
cursor/keyspace-create-custom-shards-93ca

Conversation

@maxenglander

@maxenglander maxenglander commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

keyspace create --custom-shard creates a Vitess keyspace with explicit shard ranges and an optional cluster size per shard. It cannot be combined with --shards. The API checks that the ranges cover the keyspace and that the sizes are allowed.

pscale keyspace create db main events \
  --cluster-size PS_40 \
  --custom-shard 'key-range=-40,cluster-size=PS_80' \
  --custom-shard 'key-range=40-80' \
  --custom-shard 'key-range=80-,cluster-size=PS_20'
Open in Web Open in Cursor 

Create a Vitess keyspace with explicit shard key ranges and optional
per-shard cluster-size overrides via --custom-shard
'key-range=<range>[,cluster-size=<size>]'. The flag is repeatable,
requires at least two entries, and cannot be combined with --shards.

CreateKeyspaceRequest gains CustomShards and Shards becomes a pointer so
custom-shard requests omit "shards" while ordinary creates still send
the default of one shard.

Co-authored-by: max <max@planetscale.com>
@maxenglander
maxenglander requested a review from a team as a code owner October 22, 2026 21:41
@cursor
cursor Bot marked this pull request as draft October 22, 2026 22:06

@maxenglander maxenglander left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in PR body, drop headers, and drop changes and tests section.

Comment thread internal/planetscale/keyspaces.go Outdated
Comment on lines +89 to +90
// Shards is the number of equally sized shards. It is mutually exclusive
// with CustomShards and is omitted from the request when nil.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read the room. do you see comments on other members of this struct?

CreateKeyspaceRequest fields and neighboring request types in this file
are uncommented.

Co-authored-by: max <max@planetscale.com>
@maxenglander
maxenglander marked this pull request as ready for review October 23, 2026 16:33

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.

3 participants