tabletop-commander/prisma/prismaClient.ts
Emma 56f0442d33 game systems: game system pages, game system create
components: moved DevTool to client component
2024-03-19 11:20:15 -06:00

14 lines
365 B
TypeScript

import { PrismaClient } from "@prisma/client";
const prismaClientSingleton = () => {
return new PrismaClient();
};
declare global {
var prismaGlobal: undefined | ReturnType<typeof prismaClientSingleton>;
}
export const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();
if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;