Getting Started
Make sure to first set up your PlanetScale developer environment. Once you’ve installed thepscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.
Postgres
Create role credentials with
pscale role, then connect using a connection string.pscale connect is not supported.Vitess / MySQL
Create a branch password with
pscale password, then connect with a connection string or pscale connect.The role command
Manage database roles for a Postgres database branch. This command is only supported for Postgres databases.
Usage:
Available sub-commands
Service token automation: role
Legend: ✅ supported · Postgres only. All sub-commands require --org or PLANETSCALE_ORG.
Available flags
Global flags
Examples
The create sub-command
Create a new role for a Postgres database branch:
Usage:
--inherited-roles string- Comma-separated list of role names to inherit privileges from. Common values are ‘pg_read_all_data’ for read access, ‘pg_write_all_data’ for write access, and ‘postgres’ for admin access.--ttl duration- TTL defines the time to live for the role. Durations such as “30m”, “24h”, or bare integers such as “3600” (seconds) are accepted. The default TTL is 0s, which means the role will never expire.
The delete sub-command
Delete a role:
Usage:
--force- Delete a role without confirmation--successor string- Role to transfer ownership to before deletion. Usually ‘postgres’.
delete, rm
Example:
The get sub-command
Retrieve information about a specific role:
Usage:
The list sub-command
List all roles for a Postgres database branch:
Usage:
-w,--web- List roles in your web browser.
list, ls
Example:
The reassign sub-command
Reassign objects owned by one role to any other role:
Usage:
--force- Force reset without confirmation
The renew sub-command
Renew a role’s expiration:
Usage:
The reset sub-command
Reset the credentials for any API-created role:
Usage:
--force- Force reset without confirmation
The reset-default sub-command
Reset the credentials for the default postgres role:
Usage:
--force- Force reset without confirmation
The update sub-command
Update a role’s name:
Usage:
--name string- New name for the role

