- Replace Prisma client runtime with Drizzle ORM (zero Prisma engine/query engine in production) - Add Prisma-compatible facade (@/lib/prisma-facade.ts) backed by Drizzle for backwards compatibility - Runtime queries route through Drizzle ORM; @prisma/client is now devDependency (types only) - Remove @prisma/adapter-mariadb dependency; delete prisma-pool.ts and types/prisma.ts - New Drizzle schema layer: src/db/schema.ts (176 tables) and src/lib/db.ts (connection) - Update README documenting the dual-layer ORM architecture - Restore src/generated/ gitignore (build artifact for local type generation) - 0 TypeScript errors, 583 tests passing The facade intentionally uses `any` types to match the Prisma Client API surface, allowing existing code to run unmodified while routing queries through Drizzle at runtime.
16 lines
623 B
TypeScript
16 lines
623 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveConnectionLimit } from "./db-pool";
|
|
|
|
describe("resolveConnectionLimit", () => {
|
|
it("caps the pool during production build phases", () => {
|
|
expect(resolveConnectionLimit(40, "phase-production-build")).toBe(5);
|
|
expect(resolveConnectionLimit(40, "phase-production-compile")).toBe(5);
|
|
expect(resolveConnectionLimit(3, "phase-production-build")).toBe(3);
|
|
});
|
|
|
|
it("keeps the configured pool outside build", () => {
|
|
expect(resolveConnectionLimit(40, undefined)).toBe(40);
|
|
expect(resolveConnectionLimit(40, "phase-development-server")).toBe(40);
|
|
});
|
|
});
|