PlanetScale
Databases Service tokenManage PlanetScale databases, branches, deploy requests and backups from any Windmill script, flow or app.
Set up in 3 steps
Create a service token
In the PlanetScale dashboard, open your organization settings then Service tokens. Create one, grant it access to the databases your scripts touch, and note both halves — the id and the token itself.
Add the resource in Windmill
Open Resources, add a resource of type planetscale, and fill serviceTokenId and serviceToken.
Run your first script
Fork any script below and read before writing anything. There are dozens here, so search by the verb you need.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
Update deploy request throttler configurations
Update database throttler configurations
Update database settings
Update auto-apply for deploy request
Update an organization
Update a password
Update a backup
Skip revert period
Show the status of a query patterns report
Review a deploy request
Renew a password
Queue a deploy request
Promote a branch
List regions for an organization
List read-only regions
List public regions
List passwords
List organizations
List generated query patterns reports
List deploy requests
List deploy request reviews
List deploy operations
List databases
List database regions
List branches
List backups
List audit logs
List OAuth applications
Lint a branch schema
Get the deploy queue
Resource type
planetscale — the shape of the credential every script on this page expects.
| Field | Type | Required | What it is |
|---|---|---|---|
| serviceToken | string | No | The OAuth token to use for authentication (https://api-docs.planetscale.com/reference/oauth) |
| serviceTokenId | string | No | The OAuth token ID to use for authentication (https://api-docs.planetscale.com/reference/oauth) |
Questions
Why two fields?
PlanetScale sends the id and the token together as the authorization value. The token alone is not enough to identify which service token it is.
A database is not found
Service tokens are granted access per database, not per organization. Add the database to the token in the dashboard.
Is my token stored on the hub?
Never. It lives only in your own Windmill workspace, encrypted at rest.