Skip to content

Prisma 7: the connection URL leaves the schema and the client needs a driver adapter #268

Description

@AKogut

Dependabot raised #263 (prisma 6.19.3 → 7.9.1). It fails every check, and not for a reason a lockfile bump can settle. Ran it locally to find out what it actually asks for:

error: The datasource property `url` is no longer supported in schema files.
Move connection URLs for Migrate to `prisma.config.ts` and pass either `adapter`
for a direct database connection or `accelerateUrl` for Accelerate to the
PrismaClient constructor.

So it is two changes, not one.

Scope

  • prisma.config.ts in packages/db, holding the migrate connection URL that schema.prisma currently carries as url = env("DATABASE_URL")
  • A driver adapter (@prisma/adapter-pg) wired into getPrismaClient() in packages/db/src/index.ts
  • Every bare new PrismaClient() — roughly a dozen DB-gated test files across packages/queries, apps/api, apps/worker and apps/web construct one directly and would each need the adapter
  • prisma/seed.ts, and the prisma block in packages/db/package.json that Prisma 7 no longer reads
  • The migrate target in the Dockerfile and the deploy compose stack

The test-file spread is the part that makes this bigger than it looks: the adapter has to be constructed somewhere shared, or a dozen files grow the same four lines.

Why it is not urgent

The security reason to want Prisma 7 was deepmerge-ts — reachable through @prisma/config and fixed in its 8.x line. That is already handled by a scoped override in #266, so this is now a maintenance upgrade rather than a patch.

Suggested resolution

Close #263. Dependabot will raise it again on the next Prisma release, and by then this can be a considered migration rather than a bump that happens to be sitting in the queue.

Metadata

Metadata

Assignees

Labels

area:dbSchema & migrationsdependenciesPull requests that update a dependency filepriority:p2Nice to havetype:choreTooling, refactor, maintenance

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions