Skip to content
New issue

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

ON DUPLICATE KEY UPDATE 未按预期工作 #6944

Open
wlbwlbwlb opened this issue Apr 8, 2024 · 1 comment
Open

ON DUPLICATE KEY UPDATE 未按预期工作 #6944

wlbwlbwlb opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
type:question general questions

Comments

@wlbwlbwlb
Copy link

Your Question

	e = stat.DB().Model(stat).Clauses(clause.OnConflict{
		//Columns:      nil,
		//Where:        clause.Where{},
		//TargetWhere:  clause.Where{},
		//OnConstraint: "",
		//DoNothing:    false,
		//DoUpdates:    nil,
		UpdateAll: true,
	}).Create(&stat).Error

INSERT INTO `stat` (`date`,`reg`,`active`,`connect`,`online_device_num`,`download`,`download_android`,`download_linux`,`install`,`uninstall`) VALUES ('2024-04-08 16:33:05.293',1,1,1,1,1,2,3,4,5) ON DUPLICATE KEY UPDATE `id`=`id`

ON DUPLICATE KEY UPDATE 后面的字段未展开并填充

The document you expected this should be explained

Expected answer

@wlbwlbwlb wlbwlbwlb added the type:question general questions label Apr 8, 2024
@wlbwlbwlb
Copy link
Author

wlbwlbwlb commented Apr 9, 2024

gorm v1.25.9
mysql v8.0.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question general questions
Projects
None yet
Development

No branches or pull requests

2 participants