Hey everyone,
I'm starting a new Next.js 13 project that fully embraces the App Router (server components, async data fetching, optional edge runtime). The data layer will be PostgreSQL, and I'm torn between Prisma and TypeORM. Both work in a classic pages router, but the App Router introduces a few nuances:
binaryTargets and set engine: { binary: { ... } }. TypeORM runs on the Node runtime, so deploying to Vercel edge functions forces a fallback to a serverless function.schema.prisma. TypeORM's migration CLI feels more manual, and I've hit issues with generated SQL ordering when using synchronize: true in dev.class-validator and class-transformer, but you still write entity classes yourself, which can drift from the DB schema.include/select works fine.A minimal Prisma client init for an edge function looks like:
import { PrismaClient } from '@prisma/client';
export const prisma = new PrismaClient({
datasources: { db: { url: process.env.DATABASE_URL } },
errorFormat: 'pretty',
});
Questions:
Binary not found error? What config saved you time?Looking forward to hearing your production stories and any gotchas you discovered.
Use ``` code ``` for syntax highlighting