PlanetScale CLI commands: keyspace
Getting started
Make sure to first set up your PlanetScale developer environment. Once you've installed the pscale
CLI, you can interact with PlanetScale and manage your databases straight from the command line.
The keyspace
command
This command allows you to view your keyspaces and view or update your VSchemas.
Usage:
pscale keyspace <SUB-COMMAND> <FLAG>
Available sub-commands
Sub-command | Sub-command flags | Description |
---|---|---|
create <DATABASE_NAME> <BRANCH_NAME> <KEYSPACE_NAME> | --cluster-size <SIZE> *, --additional-replicas <NUMBER> , --shards <NUMBER> | Create a new keyspace within a database branch. |
list <DATABASE_NAME> <BRANCH_NAME> ` | List all keyspaces within a database branch. | |
show <DATABASE_NAME> <BRANCH_NAME> <KEYSPACE_NAME> | Show a specific keyspace within a database branch. | |
resize <DATABASE_NAME <BRANCH_NAME> <KEYSPACE_NAME> | --cluster-size <SIZE> , --additional-replicas <NUMBER> | Resize a keyspace. |
resize cancel <DATABASE_NAME> <BRANCH_NAME> <KEYSPACE_NAME> | Cancel an ongoing keyspace resize. | |
resize status <DATABASE_NAME> <BRANCH_NAME> <KEYSPACE_NAME> | Show the status of the keyspace's last resize | |
vschema show <DATABASE_NAME> <BRANCH_NAME> <KEYSPACE_NAME> | Show the VSchema for a sharded keyspace. Empty on non-sharded keyspaces. | |
vschema update <DATABASE_NAME> <BRANCH_NAME> <KEYSPACE_NAME> | --vschema <FILE> * | Update a VSchema of a keyspace. |
* Flag is required
Sub-command flag descriptions
Sub-command flag | Description | Applicable sub-commands |
---|---|---|
--additional-replicas <NUMBER> | <NUMBER> is the number of replicas to add to the keyspace. By default, production branches include 2 replicas. | create , resize |
--cluster-size <SIZE> | <SIZE> is the size of the database cluster. | create , resize |
--vschema <FILE> | <FILE> is the path to the updated VSchema file. | vschema update |
Available flags
Flag | Description |
---|---|
-h , --help | View help for auth command |
--org <ORGANIZATION_NAME> | The organization for the current user |
Global flags
Command | Description |
---|---|
--api-token <TOKEN> | The API token to use for authenticating against the PlanetScale API. |
--api-url <URL> | The base URL for the PlanetScale API. Default is https://api.planetscale.com/ . |
--config <CONFIG_FILE> | Config file. Default is $HOME/.config/planetscale/pscale.yml . |
--debug | Enable debug mode. |
-f , --format <FORMAT> | Show output in a specific format. Possible values: human (default), json , csv . |
--no-color | Disable color output. |
--service-token <TOKEN> | The service token for authenticating. |
--service-token-id <TOKEN_ID> | The service token ID for authenticating. |
Need help?
Get help from the PlanetScale Support team, or join our GitHub discussion board to see how others are using PlanetScale.