CockroachDB
Squid は CockroachDB database に接続し、Squid application の data source として使用できます。
CockroachDB は scalability 向けに設計された cloud-native distributed SQL database です。Squid を使用すると、CockroachDB database と統合し、他の database connector の data と join することもできます。
CockroachDB database を Squid と統合するには、次の step を完了します。
- Squid Console を開き、CockroachDB と使用する application を選択します。
- Connectors tab をクリックし、次に Available connectors をクリックします。
- CockroachDB connector を選択します。
- 次の configuration information を入力します。
- Connector ID - 簡潔で connector の識別に役立つ ID を選択します。
- Database endpoint - port number を含む database host。
- CockroachDB username
- CockroachDB password - password を非公開に保つには、Squid Secrets に保存します。
- Schema - 接続する schema の name。指定しない場合は default の
publicschema が使用されます。 - Database name - 接続する database の name。
- SSL configuration(必要な場合)

connection information を入力したら、Test connection をクリックして 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).
allowlist に追加する IP address の方法については、Cockroach Labs documentationを確認してください。
Database の保護
default では security rule が必要です。production environment では、security rule なしで connector への access を許可しないことが不可欠です。database data の保護について詳しくは、security rules documentationを参照してください。
Datatype Mapping
以下の table は CockroachDB と Squid の datatype mapping を示します。
| 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 data を操作する方法については、Client SDK documentationを参照してください。