Download src/lib/db.ts from Zero124/VR-MEDIA: direct link, hf CLI and curl.
- Browser
- Download file 311 Bytes
-
https://huggingface.co/spaces/Zero124/VR-MEDIA/resolve/main/src/lib/db.ts
- Command line
-
hf download hf://spaces/Zero124/VR-MEDIA/src/lib/db.ts
-
curl -L -o db.ts https://huggingface.co/spaces/Zero124/VR-MEDIA/resolve/main/src/lib/db.ts
311 Bytes
| import { PrismaClient } from '@prisma/client' | |
| const globalForPrisma = globalThis as unknown as { | |
| prisma: PrismaClient | undefined | |
| } | |
| export const db = | |
| globalForPrisma.prisma ?? | |
| new PrismaClient({ | |
| log: ['query'], | |
| }) | |
| if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db |