-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend zod schema with prisma.schema comments #14
Comments
Hello @olehmelnyk While this might be a nice addition, it's not going to be as simple. The case of Could you provide examples on the suggestions? Thank you for using this generator :) |
Sure. Here's an example:
Like:
|
Problem
Since Prisma does not have such a reach check as Zod has - like min/max/length, email/URL, transform, etc. - we could add those extra Zod checks using Prisma comments
///
prisma.schema
zod schema output
Suggested solution
here's an example in a similar prisma2zod generator
Just a suggestions
Maybe you can optionally provide an npm package, that generates tRPC based on zod schema from another plugin(s).
Or maybe in generator configuration, we can add pre- and post-processors to be triggered during prisma.schema generation to do some extra stuff.
The text was updated successfully, but these errors were encountered: