Skip to main content
Connect Adapt to PostgreSQL to query your database and analyze your data using natural language. Adapt connects to your database through a standard connection string, so you can explore tables and pull insights without writing SQL by hand.

Set up credentials

Adapt connects to PostgreSQL using a single connection string in the standard format:
postgresql://user:password@host:port/dbname
1

Gather your connection details

Collect the values for your database:
  • Host: the server address (for example db.example.com or an IP)
  • Port: the PostgreSQL port, 5432 by default
  • Database name: the database you want to query
  • User and password: the credentials Adapt will authenticate with
2

Create a read-only role (recommended)

For safety, create a dedicated read-only role and grant it SELECT on the schemas you want Adapt to access, rather than using a superuser account.
3

Assemble the connection string

Combine the values into one string:
postgresql://user:password@host:5432/dbname
If your server requires SSL, append ?sslmode=require to the end. Any special characters in the password must be percent-encoded.
If your database is behind a firewall or private network, make sure the host is reachable and that any required IP addresses are allowlisted.

Connect to Adapt

1

Open Integrations

In Adapt, go to Settings > Integrations.
2

Find PostgreSQL

Search for PostgreSQL and select it from the catalog.
3

Start the connection

Click Connect to open the connection form.
4

Add your credentials

Enter the values you gathered above, then click Add connection:
Secret NameValue
POSTGRES_DATABASE_URLYour PostgreSQL connection string
You can rename the connection and choose whether it is shared with your organization or kept personal to you.
5

Test the connection

Ask Adapt to list your tables or query your data.

Security

  • Credentials are encrypted at rest with AES-256
  • Use a dedicated read-only role with SELECT-only privileges
  • Connect over SSL (sslmode=require) whenever your server supports it
  • Restrict network access to your database and allowlist only trusted addresses
  • Never share your connection string publicly or commit it to source control

Capabilities

Adapt can query your PostgreSQL database. Explore your tables and analyze your data using natural language.

Examples

Explore data:
What tables are in my PostgreSQL database?
Inspect a table:
Show me the columns and types in the orders table.
Summarize records:
How many customers signed up in the last 30 days?
Analyze trends:
What are my top 10 products by total revenue this year?