We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go-gorm/playground#275
DB.Clauses where not work
except
INSERT INTO "users" ("created_at","updated_at","deleted_at","name","age","birthday","company_id","manager_id","active","id") VALUES ('2021-02-08 17:29:10.811','2021-02-08 17:29:10.811',NULL,'alice',18,NULL,NULL,NULL,false,1) ON CONFLICT ("id") DO UPDATE SET "age"=20 WHERE "name" = 'bob' RETURNING "id"
got
INSERT INTO "users" ("created_at","updated_at","deleted_at","name","age","birthday","company_id","manager_id","active","id") VALUES ('2021-02-08 17:29:10.811','2021-02-08 17:29:10.811',NULL,'alice',18,NULL,NULL,NULL,false,1) ON CONFLICT ("id") WHERE "name" = 'bob' DO UPDATE SET "age"=20 RETURNING "id"
INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`,`id`) VALUES ('2021-02-08 17:33:42.736','2021-02-08 17:33:42.736',NULL,'alice',18,NULL,NULL,NULL,false,1) ON DUPLICATE KEY UPDATE `age`=20 WHERE `name`='bob'
INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`,`id`) VALUES ('2021-02-08 17:33:42.736','2021-02-08 17:33:42.736',NULL,'alice',18,NULL,NULL,NULL,false,1) ON DUPLICATE KEY UPDATE `age`=20
The text was updated successfully, but these errors were encountered:
MySQL doesn't support on duplicated with Where
Sorry, something went wrong.
But it is also incorrect in Postgres. I expect that WHERE statement is after UPDATE SET.
WHERE
UPDATE SET
@XiaoXiaoSN Fixed this on latest master
Fix OnConflict where order for postgres, close #4073
a13b7a6
Fix OnConflict where order for postgres, close go-gorm#4073
350379c
a178cf9
jinzhu
No branches or pull requests
GORM Playground Link
go-gorm/playground#275
Description
DB.Clauses where not work
Postgres
except
got
mysql(update: MySQL doesn't support on duplicated with Where)except
got
The text was updated successfully, but these errors were encountered: