Databases are exposed by the
Databases interface embedded in rest.Rest. They are available on Standard, Pro and Enterprise plans.Creating a database
api.CreateDatabase(opts) provisions a new database from a squarecloud.DatabaseCreateOptions.
An unsupported type fails with
INVALID_DATABASE_TYPE; too little memory for the plan fails with INSUFFICIENT_MEMORY; a failure during provisioning fails with DATABASE_CREATION_FAILED.
Listing your databases
api.GetDatabases() lists every database you own as compact squarecloud.UserDatabase descriptors:
Fetching a single database
Lifecycle
Status and metrics
The database status and metrics endpoints share the same shapes as the application ones (they are type aliases) — see Managing applications for the field-by-field breakdown.Summary status for every database
Updating
api.UpdateDatabase(dbID, opts) changes the display name and/or memory allocation. At least one field must be provided.
Credentials
api.GetDatabaseCertificate(dbID) returns the TLS certificate (base64-encoded PEM):
api.ResetDatabaseCredentials(dbID, reset) rotates either the password or the certificate, using the squarecloud.DatabaseReset* constants:

