Query for Prisma like insert in multiple joined tables
Is there a way to achieve insert in multiple tables joined by foreign keys in one query like Prisma?
Or subsequent inserts in a transaction is the way?
4 Replies
Prisma doesn't do it in one query because it's impossible to write such a query in SQL. It does multiple queries behind the scenes. With Drizzle, you'll need to write those queries yourself.
Alright, Got it!
so we will always use transaction right whenever you need to insert into multiple tables?
Yep, this is the way