Database
| Variable | Required | Default | Description |
|---|---|---|---|
| DATABASE_URL | Yes | - | PostgreSQL connection string |
| PGRST_DB_SCHEMAS | No | public | Schemas to expose (comma-separated) |
| PGRST_DB_ANON_ROLE | No | - | Role for unauthenticated requests |
| PGRST_DB_POOL_SIZE | No | 10 | Connection pool size |
Authentication
| Variable | Required | Default | Description |
|---|---|---|---|
| PGRST_JWT_SECRET | No | - | JWT signing secret |
| PGRST_JWT_SECRET_IS_BASE64 | No | false | If secret is base64 encoded |
| PGRST_JWT_AUD | No | - | Required JWT audience claim |
| PGRST_JWT_ROLE_CLAIM_KEY | No | role | Claim key for role |
Server
| Variable | Required | Default | Description |
|---|---|---|---|
| PGRST_SERVER_HOST | No | 127.0.0.1 | Bind address |
| PGRST_SERVER_PORT | No | 3000 | Port to listen on |
| PGRST_SERVER_CORS_ORIGINS | No | * | CORS allowed origins |
Limits
| Variable | Required | Default | Description |
|---|---|---|---|
| PGRST_MAX_ROWS | No | 1000 | Maximum rows returned |
| PGRST_MAX_BODY_SIZE | No | 10485760 | Max request body in bytes |
Logging
| Variable | Required | Default | Description |
|---|---|---|---|
| PGRST_LOG_LEVEL | No | info | Log level (error, warn, info, debug) |
| RUST_LOG | No | - | 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