Declare databases, Pub/Sub, cron jobs, caching, object storage, and secrets with Encore.ts.
Encore Infrastructure Declaration
Instructions
Encore.ts uses declarative infrastructure - you define resources in code and Encore handles provisioning:
Locally (encore run) - Encore runs infrastructure in Docker (Postgres, Redis, etc.)
Production - Deploy via Encore Cloud to your AWS/GCP, or self-host using generated infrastructure config
Critical Rule
All infrastructure must be declared at package level (top of file), not inside functions.
Databases (PostgreSQL)
import { SQLDatabase } from "encore.dev/storage/sqldb";don't have the plugin yet? install it then click "run inline in claude" again.