forked from PolarisPyra/daphnis
21 lines
680 B
TypeScript
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;
|