From 9e300e0ff0c9d93cbaeaa86c1e2a560523107382 Mon Sep 17 00:00:00 2001 From: Sebastien Castiel Date: Mon, 29 Jan 2024 22:37:13 -0500 Subject: Use React’s cache to avoid some queries to the database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/prisma.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/prisma.ts') diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 2886a89..08ec624 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -9,7 +9,9 @@ export async function getPrisma() { prisma = new PrismaClient() } else { if (!(global as any).prisma) { - ;(global as any).prisma = new PrismaClient() + ;(global as any).prisma = new PrismaClient({ + // log: [{ emit: 'stdout', level: 'query' }], + }) } prisma = (global as any).prisma } -- cgit v1.3