Database
Managed PostgreSQL provisioned alongside your egg.
Provision a database
Provision a managed PostgreSQL database for your egg using the CLI:
hatch db add [slug]Free tier includes 50 MB of storage and 10,000 rows. The connection string is automatically injected as DATABASE_URL into your egg's environment.
Works out of the box with Prisma, Drizzle, TypeORM, SQLAlchemy, and any PostgreSQL client library.
Connect locally
Connect to your egg's PostgreSQL from your local machine:
hatch db connect [slug]This opens a WebSocket tunnel and auto-launches psql. You can also use any database client (pgAdmin, TablePlus, etc.) by connecting to the local proxy address.
--port / -p — local port (default 15432)
--host — local address (default localhost)
--no-psql — only start the tunnel, don't launch psql
Pass extra arguments to psql after --:
hatch db connect my-app -- -c "SELECT 1"Check usage
View your database status and resource consumption:
hatch db info [slug]Shows database status, storage used vs. limit, rows used vs. limit, and whether writes are blocked.
