Is it recommended to create a SQL transaction every time we try to create a foreign relationship?
prisma used to wrap every foreign upsert (2 entities) within a transaction to guarantee that both rows are created or the changes are rolled back in case of a failure. Is there a way in drizzle to achieve the same? or is it better to individually create the entities?
![](https://utfs.io/f/5977a466-b83f-46ae-9fc5-875c135f0461-or4wlc.21.40_AM.png)
1 Reply
We don't have first-level support of transactions yet
https://github.com/drizzle-team/drizzle-orm/issues/190
But in general, you would do it in Drizzle the same as you would in raw SQL