Unable to setup prisma accelerate with cloudflare workers
index.ts
.env
DATABASE_URL="prisma accelerate api key"
DIRECT_URL="database uri string"
wrangler.toml
schema.prisma
I am getting following error when I hit the server
What is going wrong here?3 Replies
Have you tried following the link that says it has the solution?
https://pris.ly/d/cloudflare-datasource-url
It worked 🙂
My bad, should have tried it at least. I was following a couple of months old video, thought It should work here as well if it's working there, that's why I was not looking to change the code.
Anyways, Thanks.
hi @Cyb3r-Jok3 @Abhaykd did this work for you. I have been using Prisma in my worker project, but when I tried to access the DB using prisma from another pages worker i started to get this error.
in the worker we're setting up the client like this:
new PrismaClient({ adapter: new PrismaD1(c.env.DB) });
assuming that Pages project require the datasource url to be set -- what value would that be?