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

Catch missing datasource earlier #4143

Open
matthewmueller opened this issue Nov 3, 2020 · 0 comments
Open

Catch missing datasource earlier #4143

matthewmueller opened this issue Nov 3, 2020 · 0 comments
Labels
domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: cli topic: error

Comments

@matthewmueller
Copy link
Contributor

Bug description

Right now you can generate a Prisma Client without a datasource. You'll find out about this at runtime:

PrismaClientInitializationError2: Error in data model: Error validating: You defined no datasource. You must define exactly one datasource.

How to reproduce

generator js {
  provider = "prisma-client-js"
}

model User {
  id Int @id
}

Expected behavior

I would have expected to see this error when you run prisma generate

Environment & setup

  • OS:
  • Database:
  • Node.js version:
  • Prisma version:

@prisma/cli          : 2.10.1
@prisma/client       : 2.10.1
Current platform     : darwin
Query Engine         : query-engine 7d0087eadc7265e12d4b8d8c3516b02c4c965111 (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine     : migration-engine-cli 7d0087eadc7265e12d4b8d8c3516b02c4c965111 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 7d0087eadc7265e12d4b8d8c3516b02c4c965111 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary        : prisma-fmt 7d0087eadc7265e12d4b8d8c3516b02c4c965111 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Studio               : 0.304.0
@matthewmueller matthewmueller added kind/improvement An improvement to existing feature and code. topic: cli topic: error tech/typescript Issue for tech TypeScript. labels Nov 3, 2020
@pantharshit00 pantharshit00 added the domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. label Apr 22, 2021
@janpio janpio changed the title Catch missing datasource earlier Catch missing datasource earlier Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: cli topic: error
Projects
None yet
Development

No branches or pull requests

2 participants