![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
gorm
gorm
二楼后座。
这个作者很懒,什么都没留下…
展开
-
gorm 如何让查询没找到数据时不报错
gorm 没找到数据时报record not found,怎么才能吧报错呢原创 2021-11-23 11:36:00 · 3742 阅读 · 0 评论 -
go语言写分表脚本
CREATE TABLE `outbound_sku_tab_00000000` ( `id` bigint(20) unsigned NOT NULL COMMENT '雪花算法', `outbound_order_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `sku_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, `sku_num_picked` int(7) NOT N原创 2021-08-14 11:26:08 · 301 阅读 · 0 评论 -
gorm 强制更新零值字段
先说解决方法,采用map传值err := getReplenishmentRunWaveDefaultSettingSqlCommon(ctx).Where("id = ?", model.ID).Updates(map[string]interface{}{ "channel_id_list": ent.ChannelIdList, "repl_type": ent.ReplType, "contains_oos": ent.ContainsOos, "contains_non_oos"原创 2021-11-16 17:13:48 · 1225 阅读 · 0 评论