Skip to main content
Use the Postgres integration to run SQL against a database that your workspace already owns. Deepline stores the connection details with the same encrypted workspace-credential system used for API keys; SQL tool calls cannot supply or override credentials.

Connect Postgres

In the Deepline dashboard, open Integrations → Postgres, then provide either:
  • A postgres:// or postgresql:// connection string
  • Individual host, port, database, user, and password fields
You can also set an optional schema as the session search path. Select Connect, then select Test. Deepline shows a success or failure toast with the connection result.

Supabase

Use the Supabase Session Pooler connection string. The direct database endpoint may require IPv6, while the Session Pooler provides a broadly reachable public endpoint.
  1. Open the Supabase project and select Connect.
  2. Open Direct connection string.
  3. Select Session pooler as the connection method.
  4. Copy the displayed PostgreSQL URI.
  5. Replace the password placeholder with the database password.
  6. In Deepline, open Integrations → Postgres → Change credentials, select Connection string, and paste the URI.
  7. Select Connect, then Test.
The resulting URI has this shape:
URL-encode reserved characters in the password. The @ before the hostname is the user-info separator and must not be preceded by shell-style backslashes. For example, encode an @ inside the password as %40 and a backslash as %5C.

Run SQL

The integration exposes one tool: postgres_run_query. It accepts one SQL statement, positional binds, a timeout, and a row limit. SELECT and read-only WITH statements are bounded and run in a read-only transaction. Mutating and DDL statements execute directly without a write opt-in flag. The connected database user’s permissions determine which statements are allowed, so use a read-only database role when writes must be prohibited. List user tables with the local Deepline CLI:
Inspect declared foreign keys before choosing a join:
For example, a Supabase project containing the PostgreSQL DVD Rental sample schema can join actors to films through film_actor:
The response includes data.rows, data.rowCount, data.columns, the command tag, and non-secret connection metadata such as the host, database, and schema.

Connection safeguards

  • Postgres credentials are workspace-scoped and encrypted at rest.
  • Tool calls always use the saved credential and cannot accept inline database credentials.
  • Require TLS is enabled by default. It encrypts the connection without verifying the server certificate; turning it off disables encryption.
  • Private, loopback, link-local, reserved, metadata, and other non-public network targets are blocked.
  • Deepline resolves and validates DNS answers before pinning the connection to an approved public address.
  • Keep reads bounded with rowLimit and SQL LIMIT clauses.