jet
jet copied to clipboard
How to update all columns on conflict
Discussed in https://github.com/go-jet/jet/discussions/237
Originally posted by rsmidt May 17, 2023 I'm trying to implement a basic upsert where I want to update all fields as soon as I hit a constraint, e.g.
Users.
INSERT(Users.AllColumns).
MODEL(user).
ON_CONFLICT(Users.ID).
DO_UPDATE(
SET(Users.AllColumns.SET(Users.EXCLUDED.AllColumns)),
)
Unfortunately, this doesn't compile. Am I doing something wrong here? Is there maybe a better way to achieve the upsert?