MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getDb

Function getDb

test/fixtures.ts:30–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28// Lazily create a Prisma client so DATABASE_URL is read at call time,
29// not at module-import time (globalSetup runs before env is configured).
30function getDb() {
31 const url =
32 process.env.DATABASE_URL ??
33 'postgresql://postgres:postgres@localhost:5432/postgres?schema=public';
34 return new PrismaClient({ datasources: { db: { url } } });
35}
36
37// ---------------------------------------------------------------------------
38// Well-known fixture IDs — import these in tests instead of hard-coding strings

Callers 2

setupPostgresFixturesFunction · 0.85
teardownPostgresFixturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected