Ship Prisma APIs faster with generated Express, Fastify, or Hono CRUD routes, OpenAPI, pagination, hooks, and guard integration.
27
stars
414
commits
TypeScript
primary language
Sep 8, 2026
updated
Ship Prisma APIs faster by generating Express, Fastify, or Hono CRUD routes, OpenAPI, pagination, hooks, and guard integration directly from your schema.
Field Guide · Full reference · npm
npm install -D prisma-generator-express
npm install @prisma/client express
// schema.prisma
generator client {
provider = "prisma-client-js"
}
generator express {
provider = "prisma-generator-express"
}
npx prisma generate
Mount the generated router:
import express from 'express'
import { PrismaClient } from '@prisma/client'
import { UserRouter } from './generated/User/UserRouter'
const prisma = new PrismaClient()
const app = express()
app.use(express.json())
app.use((req, res, next) => {
req.prisma = prisma
next()
})
app.use('/', UserRouter({ enableAll: true }))
app.listen(3000)
That is a full CRUD API with OpenAPI docs at /user/openapi.json.
enableAll: trueexposes every operation of the model. For anything beyond internal tools, restrict operations and add guard shapes — see guard integration.
findMany, create, update, delete, aggregates and more) — request body formattarget generator option — Express / Fastify / HonofindManyPaginated execution mode (Promise.all or interactive transaction) — execution mode| Framework | Target value | Generated output |
|---|---|---|
| Express | "express" (default) | express.Router() factory per model |
| Fastify | "fastify" | Fastify plugin function per model |
| Hono | "hono" | Hono instance factory per model |
Minimum supported Prisma version: 6.0.0 (CI generates and strict-typechecks emitted output against the latest 6.x and 7.x lines). Some operations require newer versions or specific database providers — see the compatibility section for the exact matrix.
Progressive SSE streaming and the materialized views router are Express-only today.
The full reference lives in docs/guide.md:
Maintainer-facing design notes: ARCHITECTURE.md.
MIT
154 commits
120 commits
115 commits
13 commits
TypeScript
93.3%
JavaScript
6.6%
Ship Prisma APIs faster with generated Express, Fastify, or Hono CRUD routes, OpenAPI, pagination, hooks, and guard integration.
27
stars
414
commits
TypeScript
primary language
Sep 8, 2026
updated
Ship Prisma APIs faster by generating Express, Fastify, or Hono CRUD routes, OpenAPI, pagination, hooks, and guard integration directly from your schema.
Field Guide · Full reference · npm
npm install -D prisma-generator-express
npm install @prisma/client express
// schema.prisma
generator client {
provider = "prisma-client-js"
}
generator express {
provider = "prisma-generator-express"
}
npx prisma generate
Mount the generated router:
import express from 'express'
import { PrismaClient } from '@prisma/client'
import { UserRouter } from './generated/User/UserRouter'
const prisma = new PrismaClient()
const app = express()
app.use(express.json())
app.use((req, res, next) => {
req.prisma = prisma
next()
})
app.use('/', UserRouter({ enableAll: true }))
app.listen(3000)
That is a full CRUD API with OpenAPI docs at /user/openapi.json.
enableAll: trueexposes every operation of the model. For anything beyond internal tools, restrict operations and add guard shapes — see guard integration.
findMany, create, update, delete, aggregates and more) — request body formattarget generator option — Express / Fastify / HonofindManyPaginated execution mode (Promise.all or interactive transaction) — execution mode| Framework | Target value | Generated output |
|---|---|---|
| Express | "express" (default) | express.Router() factory per model |
| Fastify | "fastify" | Fastify plugin function per model |
| Hono | "hono" | Hono instance factory per model |
Minimum supported Prisma version: 6.0.0 (CI generates and strict-typechecks emitted output against the latest 6.x and 7.x lines). Some operations require newer versions or specific database providers — see the compatibility section for the exact matrix.
Progressive SSE streaming and the materialized views router are Express-only today.
The full reference lives in docs/guide.md:
Maintainer-facing design notes: ARCHITECTURE.md.
MIT
154 commits
120 commits
115 commits
13 commits
TypeScript
93.3%
JavaScript
6.6%