PostgreSQL Connector¶
Strake connects natively to PostgreSQL databases using an asynchronous, pooled wire client (tokio-postgres and bb8-postgres). It supports full predicate/limit pushdown and custom schema mappings.
1. Connection Syntax¶
The PostgreSQL connection string is defined under the connection field of your SQL configuration. It supports standard PostgreSQL URI formats:
connection: "postgres://<username>:<password>@<host>:<port>/<database_name>?sslmode=<prefer|require|disable>"
Connection Example¶
2. Configuration Parameters¶
The PostgreSQL database is configured as a sql source type with dialect: postgres:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
dialect |
string | Yes | - | Must be postgres. |
connection |
string | Yes | - | PostgreSQL connection URI containing credentials. |
pool_size |
integer | No | 10 |
Maximum size of the asynchronous connection pool. |
retry |
object | No | - | Retry settings for queries and pool connection. |
3. Configuration Snippet¶
Add the following block to your sources.yaml to register a PostgreSQL source: