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
Prisma AI Help
Prisma AI Help6mo ago
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:
Error validating datasource db: the URL must start with the protocol prisma:// or prisma+postgres://
This means that Prisma now expects your connection string to use the new Accelerate/Data Proxy protocols (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:
DATABASE_URL="prisma://accelerate.prisma-data.net/?api_key=YOUR_API_KEY"

DATABASE_URL="prisma://accelerate.prisma-data.net/?api_key=YOUR_API_KEY"

- If you use migrations, also set a DIRECT_URL with your original Neon connection string:
DIRECT_URL="postgresql://user:password@host/db?sslmode=require"

DIRECT_URL="postgresql://user:password@host/db?sslmode=require"

- Update your schema.prisma:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

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 Pool
Nurul
Nurul6mo ago
Hey! Are you using Prisma Accelerate with your Neon database?
Prisma AI Help
Prisma AI Help6mo ago
✅ Great, thanks for letting us know that this solved your question!
马修·伊利沙
马修·伊利沙OP6mo ago
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
Nurul
Nurul6mo ago
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
马修·伊利沙
马修·伊利沙OP6mo ago
Aright. It is solved now. Thanks a lot

Did you find this page helpful?