refactor(api): started implementing all of the tables needed for full data synchronization

BREAKING CHANGE: refer to body
This commit is contained in:
2026-03-22 20:48:29 -05:00
parent 6b7eec67b8
commit 688a9096c2
65 changed files with 856 additions and 1463 deletions
+19
View File
@@ -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);
}
});