prisma v6.9.0 connection string
I'm using Neon postgres. Since I updated to latest prisma version, I'm getting the following:
[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: PrismaClientKnownRequestError:
Invalid p.account.findUnique() invocation in
C:\Users\dmoza\Documents\projects\my\saas\openstud\.next\server\chunks\node_modules__pnpm_4cbb8743._.js:45:45
42 }
43 }),
44 async getUserByAccount (provider_providerAccountId) {
→ 45 const account = await p.account.findUnique(
Error validating datasource db: the URL must start with the protocol prisma:// or prisma+postgres://
at Gn.handleRequestError (file:///C:/Users/dmoza/Documents/projects/my/saas/openstud/node_modules/.pnpm/@prisma+client@6.9.0_prisma_12f395b7f2c46395cb11d4f7d1b6236f/node_modules/@prisma/client/runtime/library.mjs:128:7460)
But my Neon Postgres connection string starts like this postgresql://. So what am I supposed to do?6 Replies
You opted for speed from this bot. Let's conjure up an answer right now!
With Prisma v6.9.0, you are seeing the error:
- Go to the Prisma Accelerate Console and set up Accelerate for your Neon database. - After setup, you'll get a connection string that starts with
- Update your
Prisma v6+ enforces these protocols in certain deployment scenarios to ensure compatibility with Accelerate/Data Proxy features. Using the old
You must use a
Error validating datasourceThis means that Prisma now expects your connection string to use the new Accelerate/Data Proxy protocols (db: the URL must start with the protocolprisma://orprisma+postgres://
prisma:// or prisma+postgres://) instead of the traditional postgresql:// or postgres:// when running in certain environments (such as Vercel, serverless, or when using Accelerate/Data Proxy).
What you should do:
1. Update your DATABASE_URL:- Go to the Prisma Accelerate Console and set up Accelerate for your Neon database. - After setup, you'll get a connection string that starts with
prisma:// or prisma+postgres://.- Update your
.env file:
- If you use migrations, also set a DIRECT_URL with your original Neon connection string:
- Update your schema.prisma:
Set up Neon with Accelerate Connection Pool
2. Why this change?Prisma v6+ enforces these protocols in certain deployment scenarios to ensure compatibility with Accelerate/Data Proxy features. Using the old
postgresql:// string will result in the error you are seeing.
Summary:You must use a
prisma:// or prisma+postgres:// connection string with Prisma v6.9.0 in your environment. Set up Accelerate and use the provided connection string as your DATABASE_URL to resolve the error.
If you are not using Accelerate/Data Proxy and running locally or on a traditional server, ensure your deployment a
nd Prisma version match the expected connection string protocol. If you still encounter issues, double-check your environment and Prisma configuration.
Set up Neon with Accelerate Connection PoolHey!
Are you using Prisma Accelerate with your Neon database?
✅ Great, thanks for letting us know that this solved your question!
just followed the previous response and it works now. I set everything up.
But why kinda forcing devs to use the new Accelerate? i found myself in pretty troubles, understanding not where the issues was coming from
It's not mandatory to use Accelerate. I asked if you were using Accelerate because the error you were seeing usually happens if you are using Accelerate
Aright. It is solved now. Thanks a lot