first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
18
packages/database/prisma/client.ts
Normal file
18
packages/database/prisma/client.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { PrismaClient } from "@prisma/client";
|
||||
|
||||
const prismaClientSingleton = () => {
|
||||
return new PrismaClient();
|
||||
};
|
||||
|
||||
declare global {
|
||||
var prisma: undefined | ReturnType<typeof prismaClientSingleton>;
|
||||
}
|
||||
|
||||
// biome-ignore lint/suspicious/noRedeclare: <explanation>
|
||||
const prisma = globalThis.prisma ?? prismaClientSingleton();
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
globalThis.prisma = prisma;
|
||||
}
|
||||
|
||||
export { prisma as db };
|
||||
Loading…
Add table
Add a link
Reference in a new issue