-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Generating Prisma client without any model in its schema #11582
Copy link
Copy link
Closed
Labels
good first issueAlways wanted to get involved in an open source project but don’t know where to begin? Welcome!Always wanted to get involved in an open source project but don’t know where to begin? Welcome!kind/featureA request for a new feature.A request for a new feature.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: dxtopic: prisma generateCLI: prisma generateCLI: prisma generatetopic: raw$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Milestone
Description
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.
$ npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error:
You don't have any models defined in your schema.prisma, so nothing will be generated.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueAlways wanted to get involved in an open source project but don’t know where to begin? Welcome!Always wanted to get involved in an open source project but don’t know where to begin? Welcome!kind/featureA request for a new feature.A request for a new feature.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: dxtopic: prisma generateCLI: prisma generateCLI: prisma generatetopic: raw$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli