PostgreSQL
PostgreSQL is provisioned automatically when Jetpacked detects it from your repository. A dedicated instance is created for your project and the connection string is injected as DATABASE_URL before your app starts.
Detection
Jetpacked detects PostgreSQL from:
pg,postgres, or@vercel/postgresin your dependencies- A Prisma schema with
provider = "postgresql"orprovider = "postgres" - A Drizzle config pointing to a postgres adapter
typeormwith a postgres driver
Auto-injected variable
| Variable | Value |
|---|---|
DATABASE_URL |
postgres://user:password@host:5432/dbname |
Migrations
Prisma
Jetpacked runs prisma generate before the build and prisma migrate deploy after it. No additional configuration is needed.
Drizzle
Jetpacked runs drizzle-kit migrate after the build if a drizzle.config.* file is present.
TypeORM
Jetpacked runs typeorm migration:run after the build.
Sequelize
Jetpacked runs sequelize db:migrate after the build.
Using an external database
If you want to use an existing PostgreSQL instance instead of a provisioned one, add DATABASE_URL manually in the Environment tab. Your value takes precedence over the auto-injected one.
This is useful when migrating an existing app with an established database, or when sharing a database across multiple projects.
Viewing credentials
The generated DATABASE_URL can be viewed in plain text in the Environment tab of your project. You can copy it for use in local development.
Available service slots
You can reference PostgreSQL values in other environment variables using service slots. See Service Slots for full details.
| Slot | Resolves to |
|---|---|
$postgres.url |
Full connection URL |
$postgres.host |
Hostname |
$postgres.port |
Port number |
$postgres.user |
Username |
$postgres.password |
Password |
$postgres.name |
Database name |