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
create
and connect
for a nested element in a recursive structure in the same prismaClient.x.create({...})
call Panics with Expected record selection to contain required model ID fields.: FieldNotFound
#23989
Comments
create
and connect
for a nested element in a recursive structure in the same prismaClient.x.create({...})
call Panics with Expected record selection to contain required model ID fields.: FieldNotFound
Sorry for the insistence, I'm sure you guys have enough on your plates 😅 It seems the error is being thrown from the core interpreter here // We always select IDs, the unwraps are safe.
QueryResult::RecordSelection(Some(rs)) => Some(
rs.records
.extract_selection_results_from_db_name(field_selection)
.expect("Expected record selection to contain required model ID fields.")
.into_iter()
.collect(),
), Unfortunately I'm not familiar enough with the Also, should I keep this issue or close it and open a new one in |
No, this is the correct place for it.
Next step is for someone on our side to reproduce the panic you are seeing, then we can prioritize fixing this. As you can see we have a lot of issues open, and many affect hundreds of users. So unfortunately think this will not get get an immediate reaction on our side. |
I can reproduce the panic with the provided, excellent repro repository:
|
No hahah, yeah, I'd assumed as much, so thanks for just replying in general! I wanna ask again if someone could maybe guide me towards where & how to start looking so that I might attempt fixing it myself?
|
Bug description
I've got a Data Structure which is recursive. I'm creating an entity
A1
ofTypeA
which creates sub entities ofTypeA
orTybeB
, through the tree the sub entities share a new descendantA2
ofTypeA
(at separate depths). When I callprismaClient.typeA.create({...})
with a payload which createsA2
at it's first occurrence and then connects at it's second I'm confronted with the error:Error details formatted for readability:
This happens regardless of whether I
create
and thenconnect
or useconnectOrCreate
for both instances ofA2
.How to reproduce
Repro Repo
the readme has repro instructions, basically just install and a couple of clicks in browser
Expected behavior
Well, I'd expected the thing to work 😅
Formally I suppose I'd expected
A2
to be inserted by the first "command" and then connected by the second without throwing an error.Prisma information
Links to the code are present in the repro readme
Environment & setup
macOS
sqlite
v20.11.0
Prisma Version
The text was updated successfully, but these errors were encountered: