tasko/lib/db.ts

12 lines
336 B
TypeScript
Raw Normal View History

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