DEV Community

Discussion on: Introduction to Prisma 2 with Next.js

Collapse
 
vhflat profile image
Vegard

What if you want to use prisma with multiple endpoints? Do you generate a client for each endpoint, or do you export it and import it in every endpoint?

Collapse
 
aryanjnyc profile image
Aryan J

I'd just generate a Prisma client for each endpoint. If you're using some type of serverless endpoint, I'd generate the Prisma client outside of the called function so only one client is generated (using node's caching).