-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Generating Prisma client without any model in its schema #11582
Comments
Interesting and valid use case. If we remove this hard limitation, we should probably find a way to instead communicate the missing of models another way to point it out to first time users of Prisma. |
This comment was marked as abuse.
This comment was marked as abuse.
Upvoting. Start with a flag maybe? Like |
I'd also like support this suggestion. I'm in a very similar situation as the OP, working with a service template but some services don't need any models, just the client. |
Yeah! I want this feature too! |
Same for me. |
Same for me, I don't understand how to it possible to not have any types for at least |
Same. I find myself creating a dummy model just to be able to use raw queries that aren't tied to a model. |
Yes! I'm really needing this feature too! |
@janpio I want to work on this issue, if you can guide me a little. |
I would start searching our codebase for the error message string, and then try to understand how it is thrown - and how it could be avoided. (Note: The codebase is not only this repository, but also |
Thank you. |
Hi, thought I'd make my first contribution to open source :D |
@joeyaurel, I've already forgotten for updating the branch, took too long to accept, then need to revisit the decision again as CI breaks. :) |
@janpio Any further update on this? |
Problem
We have a server template including Prisma, which works fine so far. However, we now have another server extending this template without the need of models - just raw queries. While generating the Prisma client, via
npx prisma generate
, it is complaining about not having at least one model.Obviously correct - but in this case not wanted. So, we would like to use Prisma with basically
$queryRaw
and$queryRawUnsafe
only.Suggested solution
It should be allowed to generate the Prisma Client without existing models in its schema.
Alternatives
First guess would be to add a dummy model.
The text was updated successfully, but these errors were encountered: