chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
579 stars 43 forks source link

Add an option to omit a field from the select schema #145

Open amirhhashemi opened 1 year ago

amirhhashemi commented 1 year ago

In my database I have two fields that uniquely identify a database record, id and publicId. Users of my api should only be able to use publicId for accessing a record so I need to validate that id is not in the select object that users provide.

Currently we can only omit a field from the model and input schemas. It would be nice if we had a "select" option too.

chrishoermann commented 1 year ago

@amirhhashemi I can look into this but I currently can't give you a timeframe when I can implement this.