Steve Kinney

Full-Stack TypeScript

Generate Zod Schemas from Prisma

Now that we have Prisma set up, the next part is easy. We’re going to use an aptly-named tool called zod-prisma-types.

In your Prisma configuration add the following.

generator zod {
  provider       = "zod-prisma-types"
}

And now run: npx prisma generate zod.

Boom. That’s all there is to it. But, like what if we could also generate a tRPC schema as well?

Last modified on .