Skip to content

Postgres

The Postgres adapter is a data platform adapter that can be installed and used with blackline-core, a powerful data transformation tool. With the Postgres adapter, you can easily connect to Postgres databases and run SQL commands to transform data. The adapter supports multiple profiles for managing different environments, and you can customize the adapter configuration to suit your specific needs.

Example Config

postgres_dataset.yml
profiles:
  dev:
    type: postgres
    config:
      connection:
        conninfo:
          user: { postgres_user }
          password: { postgres_password }
          host: { postgres_host }
          port: { postgres_port }
          dbname: { postgres_db }

Additional value pairs can be included in the connection dictionary and will be passed to the psycopg.connect method. The conninfo values for host, port, dbname, user, password are used to construct a connection uri connection string.

blackline.models.postgres.postgres.PostgresConnInfo

Bases: BaseModel

Parameters:

Name Type Description Default
host str required
port int required
dbname str required
user str required
password SecretStr required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/postgres/postgres.py
class PostgresConnInfo(BaseModel):
    host: str
    port: int
    dbname: str
    user: str
    password: SecretStr