service layer WIP

This commit is contained in:
2025-05-03 23:23:29 +08:00
parent fe89ec9a2b
commit be0eef39c2
8 changed files with 221 additions and 24 deletions

13
src/lib/prisma/client.ts Normal file
View File

@@ -0,0 +1,13 @@
import {PrismaClient} from "@prisma/client";
const globalForPrisma = global as unknown as { prisma: PrismaClient | undefined };
export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log: ["query", "info", "warn", "error"],
});
if (process.env.NODE_ENV !== "production") {
globalForPrisma.prisma = prisma;
}