> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# データベースの作成

> Square Cloud 上でホストされるデータベースインスタンスを作成します。

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  アカウントの API キーです。これは[アカウント設定](https://squarecloud.app/ja/account/security)で確認できます。
</ParamField>

### Parameters

<ParamField body="name" type="string" placeholder="database name" required>
  データベースの名前です。1〜32文字（英字、数字、アンダースコア（`_`）、ハイフン（`-`）、スペース）で、少なくとも1つの英字、数字、またはアンダースコアを含む必要があります。
</ParamField>

<ParamField body="memory" type="int" placeholder="RAM(in MB)" required>
  割り当てるRAMです。Redisの最小値は512、Mongoは1024です。
</ParamField>

<ParamField body="type" type="string" placeholder="database(mongo,redis)" required>
  データベースの種類です。mongo、redis、postgres、mysql。
</ParamField>

<ParamField body="version" type="string" placeholder="Version number" required>
  データベースのバージョンです。\\
  Postgres 17.6、MySQL 9.5、Mongo 8.0.11、Redis 7.4.5。
</ParamField>

### Response

<ResponseField name="status" type="string">
  呼び出しが成功したかどうかを示します。成功した場合は `success`、失敗した場合は `error` です。
</ResponseField>

<ResponseField name="response" type="object">
  レスポンスの内容です。

  <Expandable title="Toggle object">
    <ResponseField name="id" type="string">
      データベースのIDです。
    </ResponseField>

    <ResponseField name="name" type="string">
      データベースに選択した名前です。
    </ResponseField>

    <ResponseField name="memory" type="int">
      データベースに割り当てられたメモリです。
    </ResponseField>

    <ResponseField name="cpu" type="int">
      データベースに割り当てられたvCPUの数です。
    </ResponseField>

    <ResponseField name="type" type="string">
      データベースの種類です。
    </ResponseField>

    <ResponseField name="password" type="string">
      データベースのパスワードです。
    </ResponseField>

    <ResponseField name="certificate" type="string">
      接続に必要な証明書です。`.pem` ファイルに保存できます。
    </ResponseField>

    <ResponseField name="connection_url" type="string">
      データベースに接続するためのURLです。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status":"success",
    "response": {
      "id": "a14b8d5e1cb7405a851eb4c075506121",
      "name": "test",
      "memory": 1024,
      "cpu": 2,
      "type": "mongo",
      "password": "PASSWORD",
      "certificate": "CERTIFICATE_IN_BASE_64_FORMAT",
      "connection_url": "mongodb://default:PASSWORD@square-cloud-db-ID.squareweb.app:PORT"
      }
  }
  ```
</ResponseExample>
