ORMs
Prisma, Drizzle, Kysely, TypeORM, Sequelize, and Knex are supported. CRUD and transactions were verified in a real worker environment.
Use the adapter that matches your ORM. All six ORMs below were tested in a real worker environment for CRUD, transaction commit, and rollback.
import { PrismaClient } from "@prisma/client";
import { Prismarunlot } from "@runlot/pg/prisma";
const prisma = new PrismaClient({ adapter: new Prismarunlot(env.db) });
const posts = await prisma.post.findMany({ orderBy: { createdAt: "desc" }, take: 20 });
await prisma.$transaction(async (tx) => {
await tx.user.create({ data: { id: 3, name: "c" } });
});Prisma 7 uses a WASM query compiler. runlot deploy includes the .wasm file in the manifest as a separate module, so there is nothing for you to configure.
Unique constraint violations are reported as P2002, following Prisma's own convention. The other five ORMs give you SQLSTATE 23505.
Bundle size and measurements
The same scenario (create table → CRUD → transaction commit → rollback) was measured in a real worker environment.
| ORM | Full scenario | Bundle size | Configuration needed |
|---|---|---|---|
| Knex | 93 ms | 938 KB | nodejs_compat (automatic) |
| Sequelize | 137 ms | 2.7 MB | nodejs_compat (automatic) |
| Drizzle | 148 ms | 246 KB | none |
| Kysely | 148 ms | 473 KB | none |
| TypeORM | 174 ms | 2.8 MB | nodejs_compat (automatic) |
| Prisma | 291 ms | 417 KB + wasm | WASM module (automatic) |
A smaller bundle means a faster cold start. If you have not picked an ORM yet, start by looking at Drizzle or Kysely.
Migrations
Use your ORM's migration tooling only to generate SQL. Apply it with runlot pg migrate. See Migrations for details.