英文: Go tries to handle an error instead of me 问题 我正在使用GORM运行以下代码: result := db.Where("account_na...
gorm选择并以切片形式返回一列数据。
英文: gorm select and returns a column in the form of a slice 问题 gorm有没有像PHP中的某个方法可以做到这样的事情? $name := ...
在UPDATE中使用原始SQL查询的GORM十进制操作
英文: GORM decimal operations in Raw SQL query in UPDATE 问题 我正在使用GORM postgres SQL编写我的数据库查询,并在GORM中有一个...
gorm与foreignKey引用有许多关系
英文: gorm has many relation with foreignKey reference 问题 我的目标是在gorm中实现一个“has many”关系。 我不想有任何生成的ID,所以我...
Gorm属于不返回关联关系。
英文: Gorm belongs to does not return relations 问题 我有以下这些模型: type Message struct { gorm.Model UserID u...
如何将文本列的值指定为字符串联合类型?
英文: How to specify a text column's value as a string union? 问题 我有一个名为Document的结构体: type Document...
how to read Mysql json column to an embedded struct using Gorm
英文: how to read Mysql json column to an embedded struct using Gorm 问题 我正在尝试使用gorm将列读取到嵌入的结构体中,表中有一个J...
将两个gorm查询合并为一个。
英文: Turn two gorm queries into one 问题 我有以下模型: type Instance struct { gorm.Model Name string `gorm:...
自动将哈希编码数据插入gorm中。
英文: insert hash coded data in gorm automatically 问题 你可以使用GORM的钩子函数来实现在插入或更新数据时自动填充HashID列。钩子函数可以在模型的...
show json array inside of a json object using gorm
英文: show json array inside of a json object using gorm 问题 我正在尝试使用gorm进行查询。我有一个名为users的模型,就像这样: type ...
47