© 2026 Hedgehog Software, LLC

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

Upsert Multiple using EXCLUDED

hey there - I want to upsert multiple values and overwrite certain fields in case of conflicts. using plain SQL it'd be something like this:
insert into
  "surveil" ("id", "last_seen", "name")
values
  ('1','2023-09-19 10:50:38.285+00', 'BanuniZ'),
  ('2','2023-09-19 10:50:38.285+00', 'Misha')
 on conflict (id) do update set "last_seen" = EXCLUDED."last_seen"
insert into
  "surveil" ("id", "last_seen", "name")
values
  ('1','2023-09-19 10:50:38.285+00', 'BanuniZ'),
  ('2','2023-09-19 10:50:38.285+00', 'Misha')
 on conflict (id) do update set "last_seen" = EXCLUDED."last_seen"

how could I achieve this with drizzle? I couldn't find anything in the docs...
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

upsert with excluded using column name
Drizzle TeamDTDrizzle Team / help
2y ago
Upsert Multiple Rows with Conflicts postgres
Drizzle TeamDTDrizzle Team / help
2y ago
Upsert question
Drizzle TeamDTDrizzle Team / help
3y ago
UPSERT many ?
Drizzle TeamDTDrizzle Team / help
3y ago