Skip to main content

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

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

  1. Log in to your DashX workspace
  2. Navigate to Settings > Integrations
  3. Click [+] to add a new integration and select PostgreSQL
  4. Choose the environments you want to enable it for
  5. Enter the configuration below and save

Configuration

FieldDescription
HostHostname or IP address of the PostgreSQL server.
PortPort the server listens on. PostgreSQL defaults to 5432.
UserThe database user DashX connects as.
PasswordPassword for that user.
Database NameThe database to connect to.
SchemaThe schema to read tables from. Usually public.
SSL ModeHow strictly to enforce TLS on the connection.

SSL Mode options

OptionBehavior
DisableNo TLS.
PreferUse TLS if the server supports it, otherwise connect without.
RequireRequire TLS, but do not verify the server's certificate.
Verify CARequire TLS and verify the certificate is signed by a trusted CA.
Verify FullRequire TLS, verify the CA, and verify the hostname matches the certificate.
warning

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.