Open oldo opened 10 months ago
did you fix it ?
I just wanted to let you know that the below works for me.
/**
* schema.prisma
*/
model Dispute {
id String @id
status DisputeStatus @default(pending) ///@z.union([z.literal('pending'),z.literal('resolved')])
resolutionDetail String @db.VarChar(250)
}
enum DisputeStatus {
pending
resolved
}
Final outcome
export const DisputeSchema = z.object({
id: z.string(),
status: z.union([z.literal('pending'), z.literal('resolved')]),
resolutionDetail: z.string(),
});
Hi there, Have been using this package for a while now and it has saved me a lot of time! Thank you. One issue that I have been regularly facing is that enums from Prisma's generated client are of the form:
However
nestjs-zod-prisma
exports actual TS enums:I prefer that actual enums are exported, but often find that I have issues when I use the types/schemas generated by Prisma client and
nestjs-zod-prisma
interchangeably:Would it be possible to generate enums in the same way as Prisma client does? As far as I can tell, there is no way to modify the way Prisma client generates enums...