question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested relations using `createMany`

See original GitHub issue

As per my understanding await prisma.accoutns.createMany() works only on a single entity and not on sub-entities. hence i tried to use create along with createMany as mentioned in this ticket.

https://github.com/prisma/prisma/issues/4998

but currently it is not working at sub levels as well which is an issue for example.

image

What i am expecting is i should be able to efficiently create multiple entities with children entities at N level like we could currently do with .create({}) but it is highly inefficient.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:180
  • Comments:61 (4 by maintainers)

github_iconTop GitHub Comments

132reactions
AHBrunscommented, Mar 22, 2021

Hey, I just wanted to add my support for this. It would make a major difference in my project.

70reactions
renatoaraujoccommented, Jun 26, 2021

This feature would be amazing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Relation queries (Concepts) - Prisma
Prisma Client provides convenient queries for working with relations, such as a fluent API, nested writes (transactions), nested reads and relation filters.
Read more >
Laravel createMany error on nested relation - Stack Overflow
This is in relation to this question. I'm having this error: TypeError Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) ...
Read more >
How to insert relations based on a nested array in Laravel?
I have 3 tables tests , questions , options . ... These relations are set up in the models already. ... This data...
Read more >
Bulk Inserting Data with Prisma's createMany Method - YouTube
New at Prisma 2.16 is the createMany method. This method allows developers to bulk insert data instead of looping over a dataset and ......
Read more >
Eloquent: Relationships - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We've already laid the foundation — freeing you to create without sweating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found