client.databases manages Square Cloud’s managed databases (MongoDB, MySQL, PostgreSQL and Redis). Every method except create and status_all takes the database id first. To list your databases, use client.account.me(): its databases list has every database the key can see.
Database hosting needs a Standard, Pro or Enterprise plan.
Examples use the client from Creating the client. database_id is the id of one of your databases: client.account.me() lists them.
Creating a database
databases.create(name, type=, version=, memory=) takes the name by position and the other fields as keyword-only arguments.
The
password and certificate are only returned by create() (and by reset_credentials()). The call waits at least 120 s before timing out.
Getting a database
Updating a database
update(database_id, name=None, ram=None) renames or resizes a database. Both arguments are keyword-only, and those left as None are not sent. Pass at least one (400 NO_UPDATE_DATA otherwise).
Start and stop
CONTAINER_ALREADY_STARTED, CONTAINER_ALREADY_STOPPED, CONTAINER_NOT_FOUND, CONTAINER_INSUFFICIENT_DISK_SPACE, CONTAINER_NETWORK_CONFLICT or ACTION_FAILED. While a snapshot restore runs, they are 403 RESTORE_IN_PROGRESS.
Status and metrics
status(database_id) returns formatted values; raw=True (keyword-only) returns numbers. status_all() returns one summary per database. metrics(database_id) returns the last 24 hours, one point every 5 minutes, newest first.
Credentials
certificate(database_id) returns the TLS certificate as base64-encoded PEM. reset_credentials(database_id, type) rotates the password (and returns the new one) or the certificate (and returns ''). The database must be running (400 DATABASE_NOT_RUNNING).
Deleting a database
Snapshots
client.databases.snapshots has the same list, create and restore as apps. See Snapshots.
Next steps
Workspaces
Share apps with your team.
Database API reference
The REST endpoints behind these methods.
Databases from the CLI
The same actions from the terminal.

