Deploying on PostgreSQL
Install the driver
Section titled “Install the driver”uv add "buraq[postgres]"# or directly: uv add asyncpgConfigure
Section titled “Configure”DATABASE_URL = "postgresql+asyncpg://user:password@localhost:5432/mydb"Or from environment:
import osDATABASE_URL = os.environ["DATABASE_URL"]Create the database
Section titled “Create the database”psql -U postgres -c "CREATE DATABASE mydb;"psql -U postgres -c "CREATE USER myuser WITH PASSWORD 'mypassword';"psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser;"Apply migrations
Section titled “Apply migrations”buraq migrateConnection pooling
Section titled “Connection pooling”The Buraq engine is pre-configured for PostgreSQL with:
pool_size = 10— maintained connectionsmax_overflow = 20— burst connectionspool_pre_ping = True— validate connections before use
Adjust in settings if needed:
DATABASE_POOL_SIZE = 20DATABASE_MAX_OVERFLOW = 40DATABASE_URL formats
Section titled “DATABASE_URL formats”# Standardpostgresql+asyncpg://user:pass@localhost:5432/dbname
# With SSLpostgresql+asyncpg://user:pass@host:5432/dbname?ssl=require
# Unix socketpostgresql+asyncpg://user:pass@/dbname?host=/var/run/postgresql