prismatype
v1.2.2
Published
Typebox generator for prisma schema
Downloads
236
Maintainers
Readme
PrismaType
Generate versatile TypeBox schemas from your
Prisma schema, as part of prisma generate.
The output is plain TypeBox, so you validate at runtime with Value.Check and derive
compile-time types with Static — from a single source of truth.
Requirements
- Prisma 7 or newer
- Node.js 22 or newer
- TypeBox 1.x or newer (the unscoped
typeboxpackage, or a package that re-exports the 1.x API)
Install
npm i -D prismatype
pnpm i -D prismatype
bun add -D prismatypeAdd the generator to your schema.prisma:
generator prismatype {
provider = "prismatype"
output = "./prismatype"
inputModel = true
}Then generate:
npx prisma generatePrismaType writes one .ts file per model into a models/ subdirectory of the output
directory, plus a shared enums.ts, a model.ts re-export, and the __nullable__ /
__transformDate__ helpers at the output root.
⚠️ The output directory is wiped and recreated on every generate. Point
outputat a folder that PrismaType fully owns — don't keep hand-written files there.
Documentation
Read the full documentation for guides, configuration, and annotations.
