Skip to main content

CockroachDB

Squid can connect to a CockroachDB database to serve as the data source for your Squid application.

CockroachDB is a cloud-native, distributed SQL database designed for scalability. With Squid, you can integrate with your CockroachDB database and even join data with other database integrations.

To integrate your CockroachDB database with Squid, complete the following steps:

  1. Open the Squid Console and select your application to use with CockroachDB.
  2. Click the Integrations tab, and then click Available integrations to view all integrations.
  3. Select the CockroachDB integration.
  4. Provide the following configuration information:
  • Integration ID - Choose an ID that is brief and helps identify the integration.
  • Database endpoint - The database host including the port number.
  • CockroachDB username
  • CockroachDB password - To keep it private, store your password in Squid Secrets.
  • Schema - The name of the schema to connect to - If none is provided, the default public schema is used.
  • Database name - The name of the database to connect to.
  • SSL configuration (if needed)

CockroachDB integration

Once you've entered the connection information, click Test connection to confirm that the connection is configured properly.

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, use the following Squid IP addresses found in the Squid Console.

Check the Cockroach Labs documentation to learn how to add allowlisted IP addresses.

Securing your database

By default, security rules are required, and in a production environment, it's essential to never allow access to the integration without them. Learn more about securing your database data in the security rules documentation.

Datatype mapping

The following table outlines the datatype mapping between CockroachDB and Squid:

Postgresql TypeSquid Type
bigintnumber
bitstring
bit varyingstring
booleanboolean
byteastring
charstring
characterstring
character varyingstring
cidrstring
datedate
double precisionnumber
enumstring
inetstring
integerinteger
intervalstring
jsonmap or array
jsonbmap or array
macaddrstring
macaddr8string
mediumintinteger
moneynumber
numericnumber
realnumber
smallintinteger
textstring
timestring
time with time zonestring
time without time zonestring
timestampdate
timestamp with time zonedate
timestamp without time zonedate
tinyintinteger
uuidstring
varcharstring

To learn how to work with CockroachDB data in Squid, view the Client SDK documentation.