mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 23:02:17 +10:00
chore(db): delete tautological schema-mirror tests, collapse db singleton
- Delete 4 test files (auth/resume/agent schema mirrors + relations type check) that re-assert Drizzle table/column names copied verbatim from the schema files. - Collapse makeDrizzleClient() + createDatabase() into a two-line module-level singleton; preserves globalThis.__drizzle caching behaviour. Claude-Session: https://claude.ai/code/session_012Bnvt1MghwHj4qQRxuQUGa
This commit is contained in:
@@ -30,15 +30,6 @@ export function getPool() {
|
||||
return globalThis.__pool;
|
||||
}
|
||||
|
||||
function makeDrizzleClient() {
|
||||
return drizzle({ client: getPool(), relations });
|
||||
}
|
||||
|
||||
function createDatabase() {
|
||||
if (!globalThis.__drizzle) {
|
||||
globalThis.__drizzle = makeDrizzleClient();
|
||||
}
|
||||
return globalThis.__drizzle;
|
||||
}
|
||||
|
||||
export const db = createDatabase();
|
||||
// ponytail: two private fns collapsed; getPool() is already a singleton, global cache preserved
|
||||
globalThis.__drizzle ??= drizzle({ client: getPool(), relations });
|
||||
export const db = globalThis.__drizzle;
|
||||
|
||||
Reference in New Issue
Block a user