This commit is contained in:
Rizky 2024-01-25 13:54:02 +07:00
parent 3b983c1cea
commit 5b13c3c911
1 changed files with 6 additions and 2 deletions

View File

@ -8,8 +8,12 @@ export const preparePrisma = async () => {
if (!(await existsAsync(dir("node_modules/.prisma")))) {
await $({ cwd: dir(`app/db`) })`bun prisma generate`;
}
try {
const { PrismaClient } = await import("../../app/db/db");
g.db = new PrismaClient();
} catch (e) {
console.log("Prisma not initialized");
}
}
g.dburl = process.env.DATABASE_URL || "";