PostgreSQL
Connect a PostgreSQL database to DashX. Once installed, you can sync its schema into Resources and read and write its records through the DashX API.
Prerequisites
Before setting up the PostgreSQL integration, ensure you have:
- An active DashX account
- A running PostgreSQL server reachable from the internet
- Credentials for a database user DashX can connect as
Prepare a database user
Create a dedicated user for DashX rather than reusing an application or superuser account. Grant it only what it needs — read access if you only intend to query, plus write access if you want to modify records through DashX.
CREATE USER dashx WITH PASSWORD 'a-strong-password';
GRANT CONNECT ON DATABASE your_database TO dashx;
GRANT USAGE ON SCHEMA public TO dashx;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO dashx;
If DashX should also write records, add the relevant privileges:
GRANT INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO dashx;
Allow network access
Your database must accept connections from DashX. Depending on where it is hosted this may mean adjusting a firewall rule, a security group, or the provider's list of allowed addresses.
Connect to DashX
- Log in to your DashX workspace
- Navigate to Settings > Integrations
- Click [+] to add a new integration and select PostgreSQL
- Choose the environments you want to enable it for
- Enter the configuration below and save
Configuration
| Field | Description |
|---|---|
| Host | Hostname or IP address of the PostgreSQL server. |
| Port | Port the server listens on. PostgreSQL defaults to 5432. |
| User | The database user DashX connects as. |
| Password | Password for that user. |
| Database Name | The database to connect to. |
| Schema | The schema to read tables from. Usually public. |
| SSL Mode | How strictly to enforce TLS on the connection. |
SSL Mode options
| Option | Behavior |
|---|---|
| Disable | No TLS. |
| Prefer | Use TLS if the server supports it, otherwise connect without. |
| Require | Require TLS, but do not verify the server's certificate. |
| Verify CA | Require TLS and verify the certificate is signed by a trusted CA. |
| Verify Full | Require TLS, verify the CA, and verify the hostname matches the certificate. |
Prefer and Require do not protect against an impersonated server. Use Verify CA or Verify Full for production databases.
Sync your schema
With the integration installed, open Data > Overview and choose Sync Database to read the schema and turn tables into resources. See Resources for the full flow.
Related: the Database Hub app.