英文: Gorm read only field after create 问题 我需要在创建后将模型的一个属性设置为只读。我的代码可以正常工作,但是当我尝试更新时不会抛出任何错误。 请问你能帮我解决...
error: failed to initialize database, got error dial tcp :0: connectex: The requested address is not valid in its context
英文: error: failed to initialize database, got error dial tcp :0: connectex: The requested address is...
Golang Gorm从v1升级到v2后,作用域(scope)出现问题。
英文: Golang Gorm scope broken after upgrade from v1 to v2 问题 我曾经使用 Gorm v1。我有一个用于分页的作用域,之前是正常工作的: fun...
如何在Golang中为太多的表设计RestAPI
英文: How to design RestAPI for too many tables in Golang 问题 我认为如果我继续使用下面的方法,我将不得不写太多的代码。 我为所有的表声明了结构体...
Gorm查询格式化与`%`不兼容 – “期望0个参数,实际得到1个”
英文: Gorm query formatting breaking with `%` - "expected 0 arguments, got 1" 问题 我遇到了一个错误,错误...
Gorm从数据库中检索到的UUID值与数据库中的值不同 – MSSQL
英文: Gorm retrive different UUID value from that in the database - MSSQL 问题 模型 type Invoice struct { ...
How to solve gorm Create() panic with "invalid memory address or nil pointer dereference"?
英文: How to solve gorm Create() panic with "invalid memory address or nil pointer dereference&qu...
在Gorm(Go语言的ORM库)中使用指针引用来关联外键模型。
英文: Using a pointer reference to a foreign-key related model in Gorm (golang) 问题 假设你有以下数据库模型: packag...
如何使用GORM创建具有嵌套/解组数据的Many2Many的POST方法?
英文: How to create post method GORM Many2Many with nested/unmarshal data? 问题 我正在使用GoFiber、GORM和MySQL数...
我们可以使用Go协程(goroutines)来并发地运行查询。
英文: How can we run queries concurrently, using go routines? 问题 我正在使用gorm v1(ORM),go版本为1.14。 DB连接在我的应...
47