Skip to main content
DBHost serves application queries through PgBouncer in transaction mode on port 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:
Set the pooled runtime URL in your app’s private environment. Replace every placeholder with the values for the runtime role (or the legacy owner):
Generate Prisma Client from your own schema using an explicit output path as shown in Prisma’s generator guide. Then pass a PostgreSQL adapter the pooled URL in server-only code:
Adjust the import to the output path you chose in schema.prisma. Keep this module on the server; do not import it into a Client Component.

Schema changes

Do not point prisma 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:
Your app keeps using 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