Inserting with Relation

Hi, What is the way of inserting a new record with a relationship in Drizzle. I understand that Prisma abstracts this away as if you are inserting everything as once but under the hood it breaks it up into multiple queries. Is there anything like this in drizzle?
3 Replies
Md Jahidul Islam milon
use transaction check drizzle doc about transaction
Liam
LiamOP2y ago
Ok, so would I just do the inserts sharing the same foreign keys?
Md Jahidul Islam milon
yes insert in all related table inside a transection. so that if one failed it can rollback automatically
Want results from more Discord servers?
Add your server