From a86156d805031f0fa3b131dc4fac5a7b10deb66f Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 10 Feb 2024 03:05:29 +0000 Subject: chore: Enable prisma logging in dev env --- packages/db/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/db/index.ts b/packages/db/index.ts index fa46ca1f..4a0f473f 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -1,6 +1,11 @@ import { PrismaClient } from "@prisma/client"; -const prisma = new PrismaClient(); +const prisma = new PrismaClient({ + log: + process.env.NODE_ENV === "development" + ? ["query", "error", "warn"] + : ["error"], +}); // For some weird reason accessing @prisma/client from any package is causing problems (specially in error handling). // Re export them here instead. -- cgit v1.2.3-70-g09d2