// File: index.ts // Path: packages/db/src/index.ts // Project: AI Risk Index — airiskindex.io // Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // Copyright © 2026 Simon-Pierre Boucher. All rights reserved. // // Description: Prisma client singleton shared across apps. import { PrismaClient } from "@prisma/client"; // Singleton to avoid exhausting connections under Next.js dev hot-reload. const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient }; export const prisma = globalForPrisma.prisma ?? new PrismaClient(); if (process.env.NODE_ENV !== "production") { globalForPrisma.prisma = prisma; } export * from "@prisma/client";