first commit
This commit is contained in:
20
lib/prisma.ts
Normal file
20
lib/prisma.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { PrismaClient as daphnisClient } from "@/prisma/schemas/daphnis/generated/lachesis";
|
||||
import { PrismaClient as artemisClient } from "@/prisma/schemas/artemis/generated/artemis";
|
||||
|
||||
const daphnisSingleton = () => {
|
||||
return new daphnisClient();
|
||||
};
|
||||
|
||||
const aremisSingleton = () => {
|
||||
return new artemisClient();
|
||||
};
|
||||
|
||||
declare global {
|
||||
var daphnis: undefined | ReturnType<typeof daphnisSingleton>;
|
||||
var artemis: undefined | ReturnType<typeof aremisSingleton>;
|
||||
}
|
||||
|
||||
export const daphnis = globalThis.daphnis ?? daphnisSingleton();
|
||||
export const artemis = globalThis.artemis ?? aremisSingleton();
|
||||
|
||||
if (process.env.NODE_ENV !== "production") globalThis.daphnis = daphnis;
|
Reference in New Issue
Block a user