Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sqlbuild.com/llms.txt

Use this file to discover all available pages before exploring further.

PostgreSQL requires the optional psycopg dependency:
pip install 'sqlbuild[postgres]'
# or
uv pip install 'sqlbuild[postgres]'

Connection config

adapter = "postgres"

[connection]
host = "localhost"
port = 5432
user = "my_user"
password = "my_password"
dbname = "my_database"
FieldDescription
hostPostgreSQL server hostname (default: localhost)
portPostgreSQL server port (default: 5432)
userDatabase user
passwordDatabase password
dbnameDatabase name
All fields in connection are passed to psycopg.connect(). See the psycopg documentation for all available options.

Per-environment connections

adapter = "postgres"

[connection]
host = "localhost"
user = "my_user"
password = "${ENV:PG_PASSWORD}"

[environments.prod]
schema = "prod"

[environments.prod.connection]
host = "prod-db.example.com"
dbname = "analytics"

[environments.dev]
schema = "dev"

[environments.dev.connection]
dbname = "analytics_dev"