CLI crash when run on empty `schema.prisma`
See original GitHub issuenpm init -y
npm install prisma@dev
- Then:
C:\Users\Jan\Documents\throwaway\envRepro (envRepro@1.0.0)
λ npx prisma db push
Prisma schema loaded from schema.prisma
Error: Get config thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', query-engine\query-engine\src\opt.rs:148:21
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
C:\Users\Jan\Documents\throwaway\envRepro (envRepro@1.0.0)
λ npx prisma migrate dev
Prisma schema loaded from schema.prisma
Error: Get config thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', query-engine\query-engine\src\opt.rs:148:21
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
vs. handled error in Introspection:
C:\Users\Jan\Documents\throwaway\envRepro (envRepro@1.0.0)
λ npx prisma introspect
Prisma schema loaded from schema.prisma
Introspecting based on datasource defined in schema.prisma …
Error: There is no datasource in the schema.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Engine panics when schema.prisma is empty, we could make ...
During the rendering of the error (putting the nice underlines and such) this crashes because the original input is less long in this...
Read more >Error message reference - Prisma
Prisma Client throws a PrismaClientRustPanicError exception if the underlying engine crashes and exits with a non-zero exit code. In this case, the Prisma ......
Read more >Prisma CLI Command Reference
This page gives an overview of all available Prisma CLI commands, explains their ... Run prisma db pull to turn your database schema...
Read more >Handling exceptions and errors (Reference) - Prisma
This will throw an error because the email field has the @unique attribute applied to it. schema.prisma.
Read more >Migration troubleshooting in development - Prisma
If Prisma Migrate detects a migration history conflict when you run prisma migrate dev , the CLI will ask to reset the database...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Couldn't find a datasource in the prisma.schema file
message appearing inprisma db push
comes from theensureDatabaseExists
function ofensureDatabaseExists.ts
There is no datasource in the schema.
message appearing inprisma db pull
comes from the query engines, e.g., from here.We should:
getdmmf
and others handle this problem.Side question: Why are
db push
anddb pull
different than the others?