import { PrismaClient } from "@prisma/client";

export const prisma = new PrismaClient({
  log: [
    { emit: "event", level: "error" },
    { emit: "event", level: "warn" },
  ],
});

prisma.$on("error", (e: any) => {
  console.error("[prisma:error]", e);
});

prisma.$on("warn", (e: any) => {
  console.warn("[prisma:warn]", e);
});
