Skip to content

Redshift guide

Installation

The Redshift ADBC driver is distributed via the ADBC Driver Foundry, not PyPI. Follow the Foundry installation guide to install it before using RedshiftConfig.

adbc-poolhouse does not need a separate extra for Redshift:

pip install adbc-poolhouse

Connection

RedshiftConfig supports provisioned clusters (standard SQL auth and IAM) and Redshift Serverless. Specify the connection as a URI or via individual fields.

URI

from adbc_poolhouse import RedshiftConfig, create_pool

config = RedshiftConfig(
    uri="redshift://me:s3cret@my-cluster.us-east-1.redshift.amazonaws.com:5439/mydb",  # pragma: allowlist secret
)
pool = create_pool(config)

Individual fields

config = RedshiftConfig(
    host="my-cluster.us-east-1.redshift.amazonaws.com",
    port=5439,
    user="me",
    password="s3cret",  # pragma: allowlist secret
    database="mydb",
)
pool = create_pool(config)

Loading from environment variables

RedshiftConfig reads all fields from environment variables with the REDSHIFT_ prefix:

export REDSHIFT_HOST=my-cluster.us-east-1.redshift.amazonaws.com
export REDSHIFT_USER=me
export REDSHIFT_PASSWORD=s3cret  # pragma: allowlist secret
export REDSHIFT_DATABASE=mydb
config = RedshiftConfig()  # reads from env

See also