PlanetScale
PlanetScale is a serverless MySQL and PostgreSQL database platform built on Vitess.Resources
Database
Create, manage and delete PlanetScale databases.Props
string
default:"process.env.PLANETSCALE_ORGANIZATION"
The organization name where the database will be created
string
default:"${app}-${stage}-${id}"
The name of the database
PlanetScaleClusterSize
required
The database cluster size (e.g., PS_10, PS_20, PS_40, PS_80, PS_160, PS_320, PS_400)
'mysql' | 'postgresql'
default:"mysql"
The engine kind for the database
object
The region where the database will be created
number
The number of replicas for the database. 0 for non-HA, 2+ for HA
boolean
Whether to adopt the database if it already exists in PlanetScale
boolean
default:"true"
Whether to delete the database when the resource is destroyed. When false, the database will only be removed from the state but not deleted via API.
boolean
Whether or not deploy requests must be approved by a database administrator other than the request creator
boolean
Whether or not to limit branch creation to the same region as the one selected during database creation
boolean
Whether or not full queries should be collected from the database
boolean
Whether or not the web console can be used on the production branch of the database
string
default:"main"
The default branch of the database
boolean
Whether or not to copy migration data to new branches and in deploy requests (MySQL only)
string
A migration framework to use on the database (MySQL only)
string
Name of table to use as migration table for the database (MySQL only)
boolean
Whether or not data branching is allowed on the database (MySQL only)
boolean
Whether or not foreign key constraints are allowed on the database (MySQL only)
string
The PostgreSQL major version to use for the database (PostgreSQL only)
'x86' | 'arm'
The CPU architecture for the database (PostgreSQL only)
Returns
string
The unique identifier of the database
string
The name of the database
string
The current state of the database
string
The default branch name
string
The plan type
string
Time at which the database was created
string
Time at which the database was last updated
string
HTML URL to access the database
string
The organization of the database
Branch
Create or manage a PlanetScale database branch.Props
string | Database
required
The database name or Database object
string
The organization name. Automatically inferred from the database if the database is provided as an object.
string
default:"${app}-${stage}-${id}"
The name of the branch
boolean
required
Whether or not the branch should be set to a production branch or not
string | Branch
default:"main"
The parent branch name or Branch object
boolean
Whether to adopt an existing branch if it exists. If false and the branch exists, an error will be thrown. If true and the branch exists, it will be updated with the provided properties.
boolean
default:"true"
Whether to delete the branch when the resource is destroyed. When false, the branch will only be removed from the state but not deleted via API.
string
If provided, restores the backup’s schema and data to the new branch. Must have restore_production_branch_backup(s) or restore_backup(s) access.
'last_successful_backup'
If provided, restores the last successful backup’s schema and data to the new branch. Must have restore_production_branch_backup(s) or restore_backup(s) access, in addition to Data Branching being enabled for the branch.
PlanetScaleClusterSize
The database cluster size is required if a backup_id is provided. If the branch is not a production branch, the cluster size MUST be “PS_DEV”.
boolean
Enable or disable safe migrations on this branch
Returns
string
The name of the branch
string
The name of the parent branch
string
Time at which the branch was created
string
Time at which the branch was last updated
string
HTML URL to access the branch