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

edge functions didn't make sense for database calls

This commit is contained in:
2023-10-08 21:38:09 -04:00
parent 23844c6843
commit 179ee92f6c
11 changed files with 203 additions and 239 deletions

View File

@@ -1,12 +1,11 @@
import { PrismaClient } from "@prisma/client/edge";
import { withAccelerate } from "@prisma/extension-accelerate";
import { PrismaClient } from "@prisma/client";
// 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://www.prisma.io/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices
const prismaClientSingleton = () => {
return new PrismaClient().$extends(withAccelerate());
return new PrismaClient();
};
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>;