import squarecloud as square
client = square.Client(api_key='API_KEY')
async def example():
# Create a MongoDB database with 1024MB of memory
database = await client.create_database(
name='my_database',
memory=1024, # Memory in MB
type='mongo', # "redis", "mongo", "mysql", or "postgres"
version='8' # Optional - version will be inferred if not provided
)
print(database.id) # Database identifier
print(database.name) # Database name
print(database.type) # Database type
print(database.cluster) # Database cluster
print(database.memory) # Memory allocated (MB)
print(database.cpu) # CPU allocated
print(database.password) # Database password
print(database.connection_url) # Connection URL
print(database.certificate) # TLS certificate