refactor(api): started implementing all of the tables needed for full data synchronization
BREAKING CHANGE: refer to body
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { PrismaMssql } from "@prisma/adapter-mssql";
|
||||
import { PrismaClient } from "../generated/prisma/client";
|
||||
|
||||
const databaseUrl = Bun.env.DATABASE_URL;
|
||||
|
||||
if (!databaseUrl) {
|
||||
throw new Error("DATABASE_URL is not set.");
|
||||
}
|
||||
|
||||
const adapter = new PrismaMssql(databaseUrl, { schema: "dbo" });
|
||||
|
||||
export const prisma = new PrismaClient({ adapter });
|
||||
|
||||
// Global error handler for unhandled Prisma promise rejections
|
||||
process.on("unhandledRejection", (reason, promise) => {
|
||||
if (reason && typeof reason === "object" && "code" in reason) {
|
||||
console.error("Unhandled Prisma Rejection:", reason);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user