Something went wrong. Try again.
An open-source, container-based Platform-as-a-Service (PAAS) for seamless deployments and effortless infrastructure management — built on f…
Something went wrong. Try again.
467 B · 18 lines
TypeScript
at devops
123456789101112131415161718
import ws from 'ws';
import { Pool, neonConfig } from '@neondatabase/serverless';import { PrismaNeon } from '@prisma/adapter-neon';import { PrismaClient } from '@prisma/client';
neonConfig.webSocketConstructor = ws;
const pool = new Pool({ connectionString: process.env.DATABASE_URL });const adapter = new PrismaNeon(pool);
const prisma = new PrismaClient({ log: ['query', 'info', 'warn', 'error'], errorFormat: 'pretty'});
export const db = prisma;