DT
Drizzle TeamLiam
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?
Md Jahidul Islam milon•320d ago
use transaction
check drizzle doc about transaction
Liam•320d ago
Ok, so would I just do the inserts sharing the same foreign keys?
Md Jahidul Islam milon•319d ago
yes insert in all related table inside a transection. so that if one failed it can rollback automatically
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.4KMembers
View on DiscordWant results from more Discord servers?
More Postssql escaping on whereTrying to do the following:
```
where: sql`unaccent(${users.fullName}) ILIKE unaccent('%${input.queBroken typescript in selectWhatever I put inside the select function. it will generate this typescript error:
I am using the laWhy is introspecting creating tables that didn't previously existMore context here: https://github.com/drizzle-team/drizzle-orm/issues/847Passing SQL functions to insertIs there any way to pass a SQL function like `gen_random_uuid()` to the `insert` function, for a speDrizzle-kit database push connection errorWhen trying to run `drizzle-kit push:mysql` to push my schema to Planetscale, I get the following erTypescript error when importing the planetscale-drizzle db instance.my db is hosted on planetscale and im trying to do the setup as explained in the drizzle docs but whMapped column name and relation with the original nameHi, I am taking over an old project and have found an issue, I'm not sure if I should file it as a bHow to properly do foreign keys in schema with PlanetScale?I'm aware that foreign key *constrains* aren't supported, but foreign keys themselves are.
push:
``