Single source of truth for models using Zod and Prisma
I feel I'm redundantly defining my models using Zod and Prisma. I do a rough db-fitting definition in my Prisma schema file, and another more detailed one in my Zod schemas.
I tried using
prisma-zod-generator
prisma-zod-generator
to have my Prisma schema file as a SSoT, but since I need more detailed validations like min/max for numeric values, and also more complex refinements, this solution is not good enough.
How do you guys do it? Do you have any recommendations?