daphnis/lib/prisma.ts
2024-06-29 02:25:52 -04:00

21 lines
680 B
TypeScript

import { PrismaClient as lachesisClient } from "@/prisma/schemas/lachesis/generated/lachesis";
import { PrismaClient as artemisClient } from "@/prisma/schemas/artemis/generated/artemis";
const lachesisSingleton = () => {
return new lachesisClient();
};
const aremisSingleton = () => {
return new artemisClient();
};
declare global {
var lachesis: undefined | ReturnType<typeof lachesisSingleton>;
var artemis: undefined | ReturnType<typeof aremisSingleton>;
}
export const lachesis = globalThis.lachesis ?? lachesisSingleton();
export const artemis = globalThis.artemis ?? aremisSingleton();
if (process.env.NODE_ENV !== "production") globalThis.lachesis = lachesis;