zod-prisma
zod-prisma copied to clipboard
Is this library alive?
This is a survival check.
I find this library very useful and I like it very much. However, I am very disappointed that maintenance has stopped and there is no way to fix bugs and support the latest prisma(v4).
@CarterGrimmeisen Do you intend to continue the maintenance of this library? If not, please recruit maintainers and give them proper authority.
P.S. There is another similar library, but I personally don't like it because it generates a lot of files when running genarate.
This is a survival check.
I find this library very useful and I like it very much. However, I am very disappointed that maintenance has stopped and there is no way to fix bugs and support the latest prisma(v4).
@CarterGrimmeisen Do you intend to continue the maintenance of this library? If not, please recruit maintainers and give them proper authority.
P.S. There is another similar library, but I personally don't like it because it generates a lot of files when running genarate.
I would say even more!
The author seems to be inresponsive, I wonder if anyone is willing to maintain a active fork and we can merge bug fixes there? @DiegoDoniss @batidodecoco @IgnusG @sourcec0de @MatthiasDunker @omar-dulaimi @aiji42 @michiim @GaelS
Sorry for disturbing, but it will benefit a lot of us if someone step forward.
@aiji42 zod-prisma
generates 1 model for each Prisma model in your schema. But prisma-zod-generator
have a different purpose; it generates schemas for all actions Prisma client provides, which makes it useful for CRUD operations.
I might implement a feature soon to generate models only; which would result in an output similar to what you get here.
@NexZhu Thanks for the mention. But to be honest, I don't think I can maintain yet another generator. As you know I have built many so far for the Prisma community, and it takes a lot of my free time.
I have been job searching these past months for remote full time roles, so until I get employed, I'm afraid I can't promise anything.
@omar-dulaimi Thank you for your reaction, I was surprised because I did not expect to get your view as the owner of prisma-zod-generator
.
I might implement a feature soon to generate models only; which would result in an output similar to what you get here.
I am really looking forward to this. If this is implemented, I will switch to your library.
The author seems to be inresponsive, I wonder if anyone is willing to maintain a active fork and we can merge bug fixes there? @DiegoDoniss @batidodecoco @IgnusG @sourcec0de @MatthiasDunker @omar-dulaimi @aiji42 @michiim @GaelS
Sorry for disturbing, but it will benefit a lot of us if someone step forward.
Unfortunately I'm not very deep into prisma yet so I wouldn't know what to do with most of these other PRs 😞
@Frando however already re-packaged this library together with my fix at @frando/zod-prisma. Maybe they can merge in some of the other popular/critical PRs as well. I'd suggest to list the ones that are interesting for you guys here.
If @Frando agrees we can then re-create them against their fork.
I've also published a fork @daotl/zod-prisma, cuz I need this PR from @michiim to be merged: https://github.com/CarterGrimmeisen/zod-prisma/pull/111 This one generates enums instead of importing from @prisma/client
and is important if you want the generated schemas to also be useable in the frontend code.
@IgnusG I've also merged your PR: https://github.com/CarterGrimmeisen/zod-prisma/pull/128
If no one else is willing to maintain a fork, I can merge other requested PRs in my fork: https://github.com/daotl/zod-prisma
I'm not currently using zod-prisma
in a production app, and am not sure if I will as we're still experimenting at the moment. So if @NexZhu is up for maintaing a fork, that'd be great. Feel free to use my fork or the commits in it. If things stabilize, I'll stop my fork and point to a maintained version instead.
OK, feel free to open issues or PRs in my fork until the author picks it up or anyone more suitable appears. https://github.com/daotl/zod-prisma
Sorry for the late reply! Seems like I've been mentioned, I like this project and I always try to use it whenever possible. There are some improvements that needs to be done to ensure a good experience between Prisma and Zod
We could go with somebody's fork and perhaps rename the package to avoid confusion
At @calcom we're using this library extensively, we could offer a sponsorship or maybe adopt and maintain this library as well. cc @PeerRich @hariombalhara
happy to continue maintaining under calcom/zod-prisma
Whats the conclusion? Wheres the project going, which fork?
Whats the conclusion? Wheres the project going, which fork?
weve not had a chance to fork this yet
@PeerRich Please do pings us
passing this decision to @zomars
just fyi: we do have a lot of other things on our plate
I think somebody should create a discord server for this generator or all prisma generators in general.
@omar-dulaimi that's probably a thing already in the Prisma discord, or at least it should reside there
@omar-dulaimi that's probably a thing already in the Prisma discord, or at least it should reside there
I thought Prisma only has Slack. Must be new or not official.
@omar-dulaimi yeah my mistake, same thing stands just for slack
Hey just noticed this. I was seriously considering switching to prisma-zod-generator and just realized that is maintained by you @omar-dulaimi 😅
What are you thoughts of this? We rather contribute to an active project and what do you think are the main differences between this generator and yours?
Hey @zomars
I think it would be great if the author managed this again, because somebody stepping up and managing it won't last for long; it's just what I imagine.
This project creates one Zod schema for each Prisma model you have in your Prisma schema. However Prisma Zod Generator
takes this a few steps further, by generating schemas for nearly everything Prisma client generates. This includes all operations like findMany
, aggregate
, upsert
, etc and all schemas needed inside each one of them for the data
, where
, etc and even enums
.
A current PR provides the ability to generate Select
schemas, and the one after it will provide Include
schemas. Once they get merged, I'm considering providing an option to generate models only, to give you guys what you have here in this project. The output will not be exactly as you get here, but very similar and does the same thing. Hopefully soon.
Inspired by @omar-dulaimi and his prisma-zod-generator
and the custom validation options of zod-prisma
by @CarterGrimmeisen I decided to take my own shot on this topic which resulted in my zod-prisma-types package that tries to combine these two approaches into a single generator.
I just released the first version and would be grateful for any feedback. I'm sure I missed some use cases. Feel free to open issues on my github repo
For anyone curious on the current state of Zod Prisma packages, here's an npm trends link:
zod-prisma-types is picking up in popularity!
Hey @zomars
I think it would be great if the author managed this again, because somebody stepping up and managing it won't last for long; it's just what I imagine.
This project creates one Zod schema for each Prisma model you have in your Prisma schema. However Prisma Zod Generator takes this a few steps further, by generating schemas for nearly everything Prisma client generates. This includes all operations like
findMany
,aggregate
,upsert
, etc and all schemas needed inside each one of them for thedata
,where
, etc and evenenums
.A current PR provides the ability to generate
Select
schemas, and the one after it will provideInclude
schemas. Once they get merged, I'm considering providing an option to generate models only, to give you guys what you have here in this project. The output will not be exactly as you get here, but very similar and does the same thing. Hopefully soon.
I want my prisma schema to be the single source of truth, for validation as well.
Does your package allow extending the generated zod types inside the schema like this?
model User {
id Int @id @default(autoincrement())
/// @zod.min(3, { message: "Must be at least 3 characters." })
username String @unique
}
@TamirCode ~https://github.com/chrishoermann/zod-prisma-types#extending-zod-fields it takes a couple of seconds to check the readme, its well written, it's a different syntax but should be practically the same~
@TamirCode https://github.com/chrishoermann/zod-prisma-types#extending-zod-fields it takes a couple of seconds to check the readme, its well written, it's a different syntax but should be practically the same
you're linking a different library to my reply, i know that one has the same thing lol im sponsoring the one you linked
Hi, I'm also looking for a lib to generate zod schemas from a schema.prisma, I liked the zod-prisma syntax. Has anyone found a good alternative? Enjoy your day 👋
https://github.com/chrishoermann/zod-prisma-types seems to be the best currently maintained option. It's similar enough to this library.
I'm down to maintain this with some other people.