import { PrismaClient, Prisma } from "./__generated__";
const { PrismaClientKnownRequestError, Decimal } = Prisma;
const logPrisma = false;
const prisma = global.prisma || new PrismaClient(
  logPrisma ? {
    log: [
      { emit: "event", level: "query" },
      {
        emit: "stdout",
        level: "error"
      },
      {
        emit: "stdout",
        level: "info"
      },
      {
        emit: "stdout",
        level: "warn"
      }
    ]
  } : {}
);
prisma.$on("query", (e) => {
  console.log(
    "Query: " + e.query.replace(/"public"\./g, "").replace(/"Project"\./g, "").replace(/"Build"\./g, "").replace(/"AuthorizationToken"\./g, "").replace(/"Asset"\./g, "")
  );
  console.log("Params: " + e.params.slice(0, 200));
  console.log("Duration: " + e.duration + "ms");
});
if (true) {
  global.prisma = prisma;
}
export {
  Decimal,
  Prisma,
  PrismaClientKnownRequestError,
  prisma
};
