© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
18 replies
Quea

onConflictDoUpdate array

Hi, is it possible to upsert/update an array?
await db.insert(organizations).values(organizationsResponse.organizations).onConflictDoUpdate({
    target:[organizations.id],
    set:{
      name:organizationsResponse.organizations.map(org=>org.name)
      
    }
  });
await db.insert(organizations).values(organizationsResponse.organizations).onConflictDoUpdate({
    target:[organizations.id],
    set:{
      name:organizationsResponse.organizations.map(org=>org.name)
      
    }
  });

I would want it to do it for all and not one by one
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

onConflictDoUpdate
Drizzle TeamDTDrizzle Team / help
5w ago
"onConflictDoUpdate" fails with error in Array.flatMap
Drizzle TeamDTDrizzle Team / help
2y ago
Multiple `onConflictDoUpdate()`
Drizzle TeamDTDrizzle Team / help
2y ago
json_arrayagg(json_array ...
Drizzle TeamDTDrizzle Team / help
2y ago