create-t3-turbo icon indicating copy to clipboard operation
create-t3-turbo copied to clipboard

Prevent creation of multiple prisma clients

Open ImBaedin opened this issue 3 years ago • 3 comments

After running into issues with the prisma client creating multiple connections, I did some digging and found that it's a common problem with next.

This PR uses a section of code from this issue to resolve the problem by preventing the client from being recreated.

Quick note: I didn't clone this repo when starting my project, I followed the article on migrating an existing t3 app. If there is already a fix for this somewhere that I missed, my bad.

ImBaedin avatar Oct 20 '22 00:10 ImBaedin

@ImBaedin is attempting to deploy a commit to the t3-oss Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 20 '22 00:10 vercel[bot]

Use the snippet we have in create-t3-app for consistency.

However I'm not sure if this is needed in monorepos? I think that's why it's not there but could have forgotten something and be completely wrong there

juliusmarminge avatar Oct 20 '22 20:10 juliusmarminge

Use the snippet we have in create-t3-app for consistency.

However I'm not sure if this is needed in monorepos? I think that's why it's not there but could have forgotten something and be completely wrong there

I was personally running into the issue, I could share access to the repo I was struggling with if that helps.

Like I said, it could be a config issue from migrating to turbo.

I'm headed to the gym now, and can update to match the convention when I get home this evening.

ImBaedin avatar Oct 20 '22 21:10 ImBaedin

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
create-t3-turbo ❌ Failed (Inspect) Oct 21, 2022 at 7:50AM (UTC)

vercel[bot] avatar Oct 21 '22 07:10 vercel[bot]