Hey folks, is it possible now to build prisma clie...
# prisma-data-platform
p
Hey folks, is it possible now to build prisma client with
dataproxy
engine and not use https://cloud.prisma.io/ ? Currently getting error:
Error: Datasource URL should use prisma:// protocol
a
Can you elaborate on the use case? When generating Prisma Client with engine type set to
dataproxy
it will 100% expect a Prisma data proxy URL. If you want to connect to a standard DB connection string, you can do that you will need to set the engine type accordingly. You can do this via env variable too.
p
I want to use prisma client in cloudflare workers-like runtime (Next.js middleware)
a
For doing that, you 100% need to use the Prisma data proxy. Otherwise it won’t work in the runtime.
👍 1
Was there a particular reason you were trying to avoid using the data proxy?
p
I’m not deploying to Vercel, just using
next build && next start
on regular server, so I have no serverless problem in my app. There is no point of proxying requests to the database in that case
a
Ah ok, you are using Next.js middlewares but in terms of runtime, you can still use TCP connections to connect to traditional DBs? Is that the case?
p
Exactly
a
OK, got it.
I am the PM for the data proxy, but I’ve shared this conversation with the Client Team since your request would be mostly relevant to them.
p
Thank you, you can also link this issue that I opened 2 days ago: https://github.com/prisma/prisma/issues/9928
m
Hey Patrick, where do you plan to deploy the next.js middleware?
p
Hey Matt, I host my app on Heroku
m
Ah okay, so you just want the capabilities of middleware (e.g. intercepting requests before being passed to pages), but don't actually care to deploy middleware to the edge. The restrictions of using middleware are acceptable.
p
Exactly
m
Okay thanks, we hadn't considered that use case yet. Right now we have separate builds: • node.js • cloudflare workers/next.js middleware. • (limited) browser I could see us unlinking the prisma cloud requirement when you don't have a prisma:// URL but still want the prisma client to run in V8 (without node). Maybe we introduce a separate feature flag. Longer term: I could see us trying to unify these builds into 1 isomorphic build. It might have different tradeoffs though like shipping the query engine binary to serverless environments. We'll see. cc @User @Hervé - Product at Prisma to be aware
🙏 1
p
Separate feature flag would be good enough, thank you!
👍 2
m
Added some context to your original issue.
p
Perfect 👌
p
i’m getting
Error: Datasource URL should use prisma:// protocol
as well, and i am following instructions for dataproxy