CockroachDB
Squid は CockroachDB データベースに接続して、Squid アプリケーションのデータソースとして利用できます。
CockroachDB は、スケーラビリティのために設計されたクラウドネイティブな分散 SQL データベースです。Squid を使用すると、CockroachDB データベースと統合し、他のデータベースコネクタとデータを結合することもできます。
CockroachDB データベースを Squid と統合するには、次の手順を完了してください。
- Squid Console を開き、CockroachDB と一緒に使用するアプリケーションを選択します。
- Connectors タブをクリックし、次に Available connectors をクリックします。
- CockroachDB コネクタを選択します。
- 次の構成情報を指定します。
- Connector ID - 短く、コネクタを識別しやすい ID を選択します。
- Database endpoint - ポート番号を含むデータベースホスト。
- CockroachDB username
- CockroachDB password - 非公開にするため、パスワードは Squid Secrets に保存してください。
- Schema - 接続するスキーマ名。指定がない場合は、デフォルトの
publicスキーマが使用されます。 - Database name - 接続するデータベース名。
- SSL configuration(必要な場合)

接続情報を入力したら、Test connection をクリックして、接続が正しく構成されていることを確認します。
Squid's IP address
To prevent denial-of-service attacks, brute force password attacks, and other forms of malicious activity, some providers recommend restricting your network to allow access only from specific IP addresses. This procedure is commonly known as allowlisting, and it limits access to your resources by only accepting connections from a specific list of endpoints.
Refer to your resource provider to determine if you need to add Squid's IP addresses to your access list. If allowlisting is required, you can find Squid's IP addresses on the application overview page of the Squid Console (located in the Cloud Provider section).
許可リストに登録された IP アドレスを追加する方法については、Cockroach Labs documentation を確認してください。
データベースの保護
デフォルトでは security rules が必須であり、本番環境では、それらなしでコネクタへのアクセスを決して許可しないことが重要です。データベースデータの保護について詳しくは、security rules documentation を参照してください。
データ型マッピング
次の表は、CockroachDB と Squid 間のデータ型マッピングを示しています。
| Postgresql Type | Squid Type |
|---|---|
| bigint | number |
| bit | string |
| bit varying | string |
| boolean | boolean |
| bytea | string |
| char | string |
| character | string |
| character varying | string |
| cidr | string |
| date | date |
| double precision | number |
| enum | string |
| inet | string |
| integer | integer |
| interval | string |
| json | map or array |
| jsonb | map or array |
| macaddr | string |
| macaddr8 | string |
| mediumint | integer |
| money | number |
| numeric | number |
| real | number |
| smallint | integer |
| text | string |
| time | string |
| time with time zone | string |
| time without time zone | string |
| timestamp | date |
| timestamp with time zone | date |
| timestamp without time zone | date |
| tinyint | integer |
| uuid | string |
| varchar | string |
Squid で CockroachDB データを扱う方法については、Client SDK documentation を参照してください。