DocsConfiguration

Configuration

All environment variables and configuration options for Postrust.

Database

VariableRequiredDefaultDescription
DATABASE_URLYes-PostgreSQL connection string
PGRST_DB_SCHEMASNopublicSchemas to expose (comma-separated)
PGRST_DB_ANON_ROLENo-Role for unauthenticated requests
PGRST_DB_POOL_SIZENo10Connection pool size

Authentication

VariableRequiredDefaultDescription
PGRST_JWT_SECRETNo-JWT signing secret
PGRST_JWT_SECRET_IS_BASE64NofalseIf secret is base64 encoded
PGRST_JWT_AUDNo-Required JWT audience claim
PGRST_JWT_ROLE_CLAIM_KEYNoroleClaim key for role

Server

VariableRequiredDefaultDescription
PGRST_SERVER_HOSTNo127.0.0.1Bind address
PGRST_SERVER_PORTNo3000Port to listen on
PGRST_SERVER_CORS_ORIGINSNo*CORS allowed origins

Limits

VariableRequiredDefaultDescription
PGRST_MAX_ROWSNo1000Maximum rows returned
PGRST_MAX_BODY_SIZENo10485760Max request body in bytes

Logging

VariableRequiredDefaultDescription
PGRST_LOG_LEVELNoinfoLog level (error, warn, info, debug)
RUST_LOGNo-Detailed tracing configuration

Example Configuration

.env
# Required
DATABASE_URL=postgres://user:password@localhost:5432/mydb

# Authentication
PGRST_DB_ANON_ROLE=web_anon
PGRST_JWT_SECRET=your-secret-key-at-least-32-characters

# Server
PGRST_SERVER_HOST=0.0.0.0
PGRST_SERVER_PORT=3000
PGRST_SERVER_CORS_ORIGINS=https://myapp.com

# Limits
PGRST_MAX_ROWS=100
PGRST_LOG_LEVEL=info