tasko/lib/db.ts

12 lines
336 B
TypeScript
Raw Normal View History

import { PrismaClient } from '@prisma/client/edge';
2024-03-17 04:48:01 +00:00
import { withAccelerate } from '@prisma/extension-accelerate';
2024-02-15 02:30:10 +00:00
declare global {
var prisma: PrismaClient | undefined;
}
2024-03-17 04:48:01 +00:00
export const db = new PrismaClient().$extends(withAccelerate());
2024-02-15 02:30:10 +00:00
2024-03-17 04:48:01 +00:00
// if (process.env.NODE_ENV !== 'production') globalThis.prisma = db;
// globalThis.prisma ??