engine.Table("test").Where().Update(map数据))无效 #443

Closed
opened 2016-08-31 07:01:20 +00:00 by week008 · 0 comments
week008 commented 2016-08-31 07:01:20 +00:00 (Migrated from github.com)

我所有的insert或者update都是指定列的
但执行engine.Table("test").Where().Update(map数据))无效
所以不得不用engine.Table("test").Where().Cols().Update(test表struct), 这样在执行该语句前,所有的字段赋值必须是两句操作:
var cols []string
cols = append(cols, 列名)
test.列名 = 值
这样很麻烦,也很容易因为遗漏某个字段赋值而出错

我所有的insert或者update都是指定列的 但执行engine.Table("test").Where().Update(map数据))无效 所以不得不用engine.Table("test").Where().Cols().Update(test表struct), 这样在执行该语句前,所有的字段赋值必须是两句操作: var cols []string cols = append(cols, 列名) test.列名 = 值 这样很麻烦,也很容易因为遗漏某个字段赋值而出错
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#443
No description provided.