timandy / GoMybatis

Mybatis for golang.
Apache License 2.0
9 stars 1 forks source link

Questions about updating operations #16

Open webbking opened 1 year ago

webbking commented 1 year ago

When updating the database, dynamically implement: ignore the field if it does not exist image

webbking commented 1 year ago

Can map[string]interface{} be used as a parameter during updates

webbking commented 1 year ago

是否可以将map 类型的数据执行更新操作。结构体对于未赋值的字段,像int类型 默认为0 ,导致原数据被覆盖。

timandy commented 11 months ago

@webbking 建议只使用查询功能, 更新操作建议使用 gorm。如果你有方法可以发个 PR

timandy commented 9 months ago

是否可以将map 类型的数据执行更新操作。结构体对于未赋值的字段,像int类型 默认为0 ,导致原数据被覆盖。

这样不合理, 如果确实要更新为 0, 将无法处理.