nikitarevenco
PPrisma
•Created by nikitarevenco on 7/15/2024 in #help-and-questions
Create prisma client with extension without circular dependency
FOUND SOLUTION:
Prisma.defineExtension
takes a callback which receives the client
---------------
If I have something like this:
Essentially, I am asking how I can perform database operations before I have actually initialised the database.2 replies
PPrisma
•Created by nikitarevenco on 7/12/2024 in #help-and-questions
Prisma Client is not configured to run in the edge runtime
18 replies
PPrisma
•Created by nikitarevenco on 7/12/2024 in #help-and-questions
Get type of prisma client before it is defined
In my next.js app I have to use the following approach to prevent multiple instances of PrismaClient being created
The above approach however is problematic because it doesn't generate the correct PrismaClient type. E.g. in my project TS will complain that
db.user.example
doesn't exist.
I tried solving this with typeof new PrismaClient().$extends(extension)
but I need globalForPrisma
to be defined before the PrismaClient has been defined12 replies