committing summative

This commit is contained in:
Archie committed 2026-11-06 10:02:29 +00:00
1 parent 73ac8e85be
commit 95b138f29e
44 files changed
+5319 -755

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { PrismaClient } from '@/lib/generated/prisma/client';
import { PrismaPg } from "@prisma/adapter-pg";
import { Pool } from "pg";
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};
function createPrismaClient() {
const pool = new Pool({ connectionString:
process.env.DATABASE_URL });
const adapter = new PrismaPg(pool);
return new PrismaClient({ adapter });
}
export const prisma = globalForPrisma.prisma ?? createPrismaClient();
if (process.env.NODE_ENV !== "production") {
globalForPrisma.prisma = prisma;
}