runlot

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.

ORMFull scenarioBundle sizeConfiguration needed
Knex93 ms938 KBnodejs_compat (automatic)
Sequelize137 ms2.7 MBnodejs_compat (automatic)
Drizzle148 ms246 KBnone
Kysely148 ms473 KBnone
TypeORM174 ms2.8 MBnodejs_compat (automatic)
Prisma291 ms417 KB + wasmWASM 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.

On this page