Skip to content

Generating Prisma client without any model in its schema #11582

@pzaenger

Description

@pzaenger

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.

Metadata

Metadata

Assignees

Labels

good first issueAlways wanted to get involved in an open source project but don’t know where to begin? Welcome!kind/featureA request for a new feature.tech/typescriptIssue for tech TypeScript.topic: dxtopic: prisma generateCLI: prisma generatetopic: raw$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions