Creating a database
client.create_database returns a Database object.
Retrieving database information
client.get_database_info returns a DatabaseInfo object.
Getting database status
client.get_database_status returns a StatusData object.
Listing all databases
client.all_databases_status returns a list of ResumedStatus objects.
Starting a database
client.start_database returns a Response object.
Stopping a database
client.stop_database returns a Response object.
Editing a database
client.edit_database returns a Response object. You can update the database name and/or memory allocation.
Deleting a database
client.delete_database returns a Response object.
Managing database credentials
Getting the database certificate
client.get_database_certificate returns a Certificate object.
Resetting database password
client.reset_database_password returns a new password string.
Resetting database certificate
client.reset_database_certificate returns a Response object.
Database data structures
Database
TheDatabase object represents a newly created database with full details:
| Property | Type | Description |
|---|---|---|
id | str | Database unique identifier |
name | str | Database name |
type | str | Database type (redis, mongo, mysql, postgres) |
cluster | str | Database cluster information |
memory | int | Memory allocated (MB) |
cpu | int | CPU allocated (vCPU) |
password | str | Database password |
certificate | Certificate | TLS certificate for secure connection |
connection_url | str | Connection URL for the database |
DatabaseInfo
TheDatabaseInfo object contains information about an existing database:
| Property | Type | Description |
|---|---|---|
id | str | Database unique identifier |
name | str | Database name |
type | str | Database type (redis, mongo, mysql, postgres) |
cluster | str | Database cluster information |
owner | str | Database owner user ID |
port | int | Database port |
ram | int | Current RAM usage (MB) |
created_at | str | Creation timestamp (ISO 8601) |
StatusData
TheStatusData object contains real-time status information about a database:
| Property | Type | Description |
|---|---|---|
ram | str | Current RAM usage |
cpu | str | Current CPU usage percentage |
network | dict | Network statistics (upload/download) |
running | bool | Whether the database is running |
storage | str | Storage usage |
Supported database types
Square Cloud supports the following databases:| Type | Default Version | Description |
|---|---|---|
redis | 7.4.5 | In-memory data store for caching and real-time applications |
mongo | 8.0.11 | NoSQL document database |
mysql | 9.5 | Relational database |
postgres | 17.6 | Advanced relational database |

