Database
Managed PostgreSQL provisioned alongside your deployment.
PostgreSQL provisioning
Add a managed PostgreSQL database to any project:
hatch db create --project my-appThis provisions a PostgreSQL instance in the same EU region as your deployment. The connection string is automatically injected as DATABASE_URL.
DATABASE_URL
Once a database is provisioned, the DATABASE_URL environment variable is automatically set for your deployment:
postgres://user:password@host:5432/dbname?sslmode=requireWorks out of the box with Prisma, Drizzle, TypeORM, SQLAlchemy, and any PostgreSQL client library.
Migrations
Run database migrations as part of your deployment or manually:
# Run migrations manually
hatch db migrate --project my-appHatch detects common migration tools (Prisma Migrate, Drizzle Kit, Alembic) and runs the appropriate command.
Database management
Manage your database from the CLI:
# View database info
hatch db info --project my-app
# Open a psql connection
hatch db connect --project my-app
# Create a backup
hatch db backup --project my-app