liara_create_database
Create a new database on Liara cloud platform by specifying name, type, and plan for MariaDB, MySQL, PostgreSQL, MongoDB, Redis, or other supported database systems.
Instructions
Create a new database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Database name | |
| type | Yes | Database type | |
| planID | Yes | Plan ID for the database | |
| version | No | Database version (optional) |
Implementation Reference
- src/services/databases.ts:32-41 (handler)The core handler function that implements the liara_create_database tool logic. It validates the required input fields (name, type, planID) and makes a POST request to the Liara API endpoint '/v1/databases' to create the database.export async function createDatabase( client: LiaraClient, request: CreateDatabaseRequest ): Promise<Database> { validateRequired(request.name, 'Database name'); validateRequired(request.type, 'Database type'); validateRequired(request.planID, 'Plan ID'); return await client.post<Database>('/v1/databases', request); }
- src/api/types.ts:157-162 (schema)TypeScript interface defining the input parameters for the liara_create_database tool: required name, type (from DatabaseType enum), planID, and optional version.export interface CreateDatabaseRequest { name: string; type: DatabaseType; planID: string; version?: string; }
- src/api/types.ts:134-143 (schema)Output type returned by the createDatabase handler, representing the created Liara database details.export interface Database { _id: string; name: string; type: DatabaseType; planID: string; status: DatabaseStatus; version?: string; createdAt: string; updatedAt: string; }
- src/api/types.ts:145-154 (schema)Union type for supported database types used in CreateDatabaseRequest.export type DatabaseType = | 'mariadb' | 'mysql' | 'postgres' | 'mssql' | 'mongodb' | 'redis' | 'elasticsearch' | 'rabbitmq';