refactor: ponytail audit

This commit is contained in:
Amruth Pillai
2026-07-27 20:26:16 +02:00
parent bb1fb3a7d6
commit 9110e86997
157 changed files with 1082 additions and 2177 deletions
+2 -4
View File
@@ -1,12 +1,10 @@
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
import { env } from "@reactive-resume/env/server";
import { relations } from "./relations";
declare global {
var __pool: Pool | undefined;
var __drizzle: NodePgDatabase<typeof relations> | undefined;
var __drizzle: ReturnType<typeof drizzle> | undefined;
}
export function getPool() {
@@ -31,5 +29,5 @@ export function getPool() {
}
// ponytail: two private fns collapsed; getPool() is already a singleton, global cache preserved
globalThis.__drizzle ??= drizzle({ client: getPool(), relations });
globalThis.__drizzle ??= drizzle({ client: getPool() });
export const db = globalThis.__drizzle;