prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

Using `createMany` with SQLite in tests results in a panic with JSON protocol

Open aqrln opened this issue 2 years ago • 4 comments

Trying to use createMany with SQLite in tests results in the following panic in tests when using JSON protocol:

thread '...' panicked at query-engine/connector-test-kit-rs/query-tests-setup/src/runner/json_adapter/request.rs:26:89:
called `Option::unwrap()` on a `None` value

Expected behaviour: a proper error instead of crashing.

For example:

  • With GraphQL protocol, whether in QE tests or end-to-end with client, it triggers a user-facing error with code 2009 and message Field 'createManyUser' not found in enclosing type 'Mutation'
  • With JSON protocol end to end it triggers an error with message Operation 'createMany' for model 'User' does not match any query.

This seems to be an issue in GraphQL to JSON translation.

Example: https://github.com/prisma/prisma-engines/actions/runs/7304950071/job/19907898417?pr=4601

aqrln avatar Dec 23 '23 00:12 aqrln

Currently expected, as Prisma doesn't support createMany at all for SQLite. I believe we already have another issue for this

jkomyno avatar Jan 05 '24 15:01 jkomyno

Panic is never expected, this issue is about having a proper error instead.

SevInf avatar Jan 08 '24 08:01 SevInf

This is actually totally unrelated to driver adapters, I'm not sure how I got this impression, sorry for confusion! This is an issue in GraphQL to JSON translation. I updated the issue description.

aqrln avatar Jan 08 '24 21:01 aqrln

I moved the issue to the tech debt board.

aqrln avatar Jan 08 '24 21:01 aqrln