StevieW
09/20/2022, 8:34 AMimport { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
const allPosts: Post[] = await prisma.post.findMany()
Each time this is called, what happens to the prisma client? Does it auto disconnect when done, and next time it's called a new one is created (then closed) or will I end up with 1000's of these open and running in the background?
If so, do I need to just create one and use that all the time? How does that work if it has to handle 1000's of requests at once?
I guess I'm just after a little guidance on how best to approach. I get these are likely basic questions! I'm moving over from Python / Django and trying to get my head around things. Thanks!StevieW
09/20/2022, 9:08 AMStevieW
09/20/2022, 9:10 AMRaphael Etim
09/20/2022, 10:19 AM