Connect a Warehouse¶
~3 minutes · ends with
dql doctorconfirming the configured connection
DQL ships 15 drivers out of the box. Connections live in dql.config.json at
the project root. Keep secrets in environment variables and reference them with
${ENV_VAR} interpolation.
1. Pick your connector¶
{
"connections": {
"default": {
"driver": "postgres",
"host": "${PGHOST}",
"port": 5432,
"database": "analytics",
"user": "${PGUSER}",
"password": "${PGPASSWORD}",
"schema": "public"
}
}
}
Per-driver options live in the Connector reference.
2. Export credentials¶
export PGHOST=prod-db.internal
export PGUSER=analyst_ro
export PGPASSWORD=...
3. Verify¶
dql doctor
# Local query runtime
# driver=postgres is available
If that passes, the notebook and CLI resolve table references against this connection.
Multiple connections¶
{
"connections": {
"default": { "driver": "duckdb", "path": "./warehouse.duckdb" },
"prod": { "driver": "snowflake", "account": "${SNOWFLAKE_ACCOUNT}" },
"raw": { "driver": "postgres", "host": "${RAW_PGHOST}" }
}
}
Reference a non-default connection from a cell:
-- @connection: prod
select count(*) from analytics.orders
Troubleshooting¶
connection refused— firewall, VPN, wrong host, or wrong port. Rundql doctorafter checking the resolved environment variables.role does not have USAGE on schema— warehouse permissions. DQL needsUSAGEon the schema andSELECTon queried objects.- BigQuery service account — set
GOOGLE_APPLICATION_CREDENTIALSto the key file path; the driver auto-picks it up.