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

Better support for generated $ids #37

Open
daedalus28 opened this issue Mar 13, 2025 · 0 comments
Open

Better support for generated $ids #37

daedalus28 opened this issue Mar 13, 2025 · 0 comments

Comments

@daedalus28
Copy link

Prismabox doesn't add $id to schemas, except confusingly in the case of Where and WhereUnique.

https://github.com/m1212e/prismabox/blob/main/src/generators/where.ts#L272
https://github.com/m1212e/prismabox/blob/main/src/generators/where.ts#L87

I find that surprising because I would expect either the Plain or final Composite types to have and $id that is set to the prisma model name. Is this intentional? My suggestion would be for each model to have an $id that matches the generated typebox name (e.g. Model, ModelPlain, ModelWhere, ModelInputCreate, etc)

FYI - I have a post processing pass I'm using after prismabox runs, so I have a way to workaround the issues I'm opening (ranging from AST transforms to plain regex manipulation). I figure it's helpful to contribute some of that back to this repo where it makes sense, but I also don't want to be burdensome. I appreciate that this repo exists!

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

1 participant