Skip to content
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

Is this library alive? #148

Open
aiji42 opened this issue Sep 2, 2022 · 30 comments
Open

Is this library alive? #148

aiji42 opened this issue Sep 2, 2022 · 30 comments

Comments

@aiji42
Copy link

aiji42 commented Sep 2, 2022

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.

@josephpierres
Copy link

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!

@NexZhu
Copy link

NexZhu commented Sep 21, 2022

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.

@omar-dulaimi
Copy link

@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.

@omar-dulaimi
Copy link

@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.

@aiji42
Copy link
Author

aiji42 commented Sep 21, 2022

@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.

@IgnusG
Copy link

IgnusG commented Sep 21, 2022

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.

@NexZhu
Copy link

NexZhu commented Sep 22, 2022

I've also published a fork @daotl/zod-prisma, cuz I need this PR from @michiim to be merged: #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: #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

@Frando
Copy link

Frando commented Sep 26, 2022

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.

@NexZhu
Copy link

NexZhu commented Sep 27, 2022

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

@arielpacciaroni
Copy link

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

@zomars
Copy link
Contributor

zomars commented Sep 29, 2022

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

@PeerRich
Copy link

PeerRich commented Oct 6, 2022

happy to continue maintaining under calcom/zod-prisma

@Nikola-Milovic
Copy link

Whats the conclusion? Wheres the project going, which fork?

@PeerRich
Copy link

Whats the conclusion? Wheres the project going, which fork?

weve not had a chance to fork this yet

@Nikola-Milovic
Copy link

@PeerRich Please do pings us

@PeerRich
Copy link

PeerRich commented Oct 31, 2022

passing this decision to @zomars

just fyi: we do have a lot of other things on our plate

@omar-dulaimi
Copy link

I think somebody should create a discord server for this generator or all prisma generators in general.

@Nikola-Milovic
Copy link

@omar-dulaimi that's probably a thing already in the Prisma discord, or at least it should reside there

@omar-dulaimi
Copy link

@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.

@Nikola-Milovic
Copy link

@omar-dulaimi yeah my mistake, same thing stands just for slack

@zomars
Copy link
Contributor

zomars commented Nov 3, 2022

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?

@omar-dulaimi
Copy link

omar-dulaimi commented Nov 4, 2022

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.

@chrishoermann
Copy link

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

@jordiup
Copy link

jordiup commented May 14, 2023

For anyone curious on the current state of Zod Prisma packages, here's an npm trends link:

image

zod-prisma-types is picking up in popularity!

@TamirCode
Copy link

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.

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
}

@Nikola-Milovic
Copy link

Nikola-Milovic commented Jun 11, 2023

@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
Copy link

TamirCode commented Jun 11, 2023

@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

@MatteoGauthier
Copy link

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 👋

@TranquilMarmot
Copy link

TranquilMarmot commented Dec 15, 2023

https://github.com/chrishoermann/zod-prisma-types seems to be the best currently maintained option. It's similar enough to this library.

@gruckion
Copy link

I'm down to maintain this with some other people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests