ljlm0402 / typescript-express-starter

📘 Quick and Easy TypeScript Express Starter
http://npm.im/typescript-express-starter
MIT License
2.71k stars 419 forks source link

Prisma connections #236

Closed MarwanRadwan7 closed 1 year ago

MarwanRadwan7 commented 1 year ago

Discussed in https://github.com/ljlm0402/typescript-express-starter/discussions/235

Originally posted by **MarwanRadwan7** October 29, 2023 Hello, I am currently reviewing the repo and I found this line ```public users = new PrismaClient().user;``` and similar in each class. I want to ask: when we make this instance in every class means we are creating a new connection to the database for example: postgresql. Does this make an excessive use of the database pools ? Or how does this work!