1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-20 20:21:18 -04:00

bump a looooooot of deps

This commit is contained in:
2023-09-01 09:30:48 -04:00
parent f6726b5926
commit 2741b3ae0c
7 changed files with 726 additions and 728 deletions

View File

@@ -2,16 +2,18 @@ import { PrismaClient } from "@prisma/client/edge";
// creating PrismaClient here prevents next.js from starting too many concurrent prisma instances and exhausting the
// number of connection pools available (especially when hot reloading from `next dev`).
// https://pris.ly/d/help/next-js-best-practices
// https://www.prisma.io/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
const prismaClientSingleton = () => {
return new PrismaClient();
};
export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
log: ["query"],
});
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>;
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClientSingleton | undefined;
};
export const prisma = globalForPrisma.prisma ?? prismaClientSingleton();
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;