14 lines
259 B
TypeScript
14 lines
259 B
TypeScript
|
import { PrismaClient } from "@prisma/client";
|
||
|
|
||
|
export const prisma =
|
||
|
globalThis.prisma ||
|
||
|
new PrismaClient({
|
||
|
log: ["query", "error", "warn"],
|
||
|
});
|
||
|
|
||
|
if (process.env.NODE_ENV !== "production") {
|
||
|
globalThis.prisma = prisma;
|
||
|
}
|
||
|
|
||
|
export default prisma;
|