Dan
Dan
Explore posts from servers
DTDrizzle Team
Created by rodrigo on 7/22/2023 in #help
Insert multiple rows + onConflictDoUpdate
Yes, I'm using it like this:
const result = await ctx.db
.insert(Regions)
.values(regionValues)
.onConflictDoUpdate({
target: Regions.id,
set: {
name: sql`EXCLUDED.name`,
en: sql`EXCLUDED.en`,
de: sql`EXCLUDED.de`,
parentId,
},
})
.returning();
const result = await ctx.db
.insert(Regions)
.values(regionValues)
.onConflictDoUpdate({
target: Regions.id,
set: {
name: sql`EXCLUDED.name`,
en: sql`EXCLUDED.en`,
de: sql`EXCLUDED.de`,
parentId,
},
})
.returning();
4 replies
DTDrizzle Team
Created by Dan on 6/17/2023 in #help
How to do migrations that require data changes?
That's exactly what I was looking for, thank you!
5 replies