Replies: 2 comments 1 reply
-
|
The import { enhancePrisma } from "blitz"
import { PrismaClient } from "@prisma/client"
const EnhancedPrisma = enhancePrisma(PrismaClient)
export * from "@prisma/client"
export default new EnhancedPrisma()As for your build issue, I'm guessing you have a bunch of getStaticProps that are reading the DB? That's the only thing that should read from the DB at build time. And I thought the singleton that we use internally would work for that, but maybe not? 🤔 |
Beta Was this translation helpful? Give feedback.
-
|
@flybayer |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is a way to initialize Prisma Client once at build step to avoid "FATAL: too many connections" at build time?
I've tried to cache using https://github.com/blitz-js/blitz/issues/485 solution, and using a singleton class.
But dont work
Cache
Singleton
Beta Was this translation helpful? Give feedback.
All reactions