6432. Prisma Client can use a pooled runtime URL through its PostgreSQL driver
adapter. Prisma Migrate and prisma db push need a direct database connection
according to Prisma’s PgBouncer guide.
On DBHost, use the direct migration connection
(available for databases with managed SQL roles) for those commands, and the
pooled URL for your app.
1. Create a database and choose a role
Create a database from the DBHost dashboard. Managed SQL roles gives you separate owner, runtime, and read-only credentials on every plan. Use the runtime role for your app and the owner role for schema changes. With legacy creation, the single database login remains the owner. Copy the exact database name, selected username, and password from the detail page. A managed username is generated separately from the database name. Keep the connection URL in a private environment store and never commit it.2. Configure Prisma Client
This example targets Prisma ORM 7, which requires Node.js 20.19 or later. Pin the packages to one major version:schema.prisma. Keep this
module on the server; do not import it into a Client Component.
Schema changes
Do not pointprisma migrate dev, prisma migrate deploy, or prisma db push
at the PgBouncer runtime URL. Prisma reads a separate migration URL from
prisma.config.ts. Set it to the direct migration profile while a lease is
active:
DATABASE_URL on port 6432. On a single-login database
without managed SQL roles, apply reviewed SQL with the owner login instead. A
runtime role cannot perform DDL.
prisma migrate dev can also require a separate shadow database; DBHost does
not grant CREATEDB on the shared PostgreSQL host. See Prisma’s shadow database
guide
before using that command.
Next steps
- DBHost quickstart for connection details and TLS.
- Next.js + pg for an end-to-end query with no ORM migration dependency.
- Prisma’s PgBouncer guidance for current adapter and direct-URL requirements.