PostgreSQL
Squid can connect to a PostgreSQL database to serve as the data source for your Squid application.
PostgreSQL is an open source object-relational database system designed for reliability, feature robustness, and performance. With Squid, you can integrate with your PostgreSQL database and even join data with other database integrations.
To integrate your PostgreSQL database with Squid, complete the following steps:
- Open the Squid Console and select your application to use with PostgreSQL.
- Click the Integrations tab, and then click Available integrations to view all integrations.
- Select the PostgreSQL integration.
- 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.
- PostgreSQL username
- PostgreSQL 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)
Once you've entered the connection information, click Test connection to confirm that the connection is configured properly.
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.
The following table outlines the datatype mapping between PostgreSQL and 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 |
To learn how to work with PostgreSQL data in Squid, view the Client SDK documentation.