Gorm When reading from the db, If there's a gorm:"default:null" then the returned resource doesn't have it's values set correctly.

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/602DescriptionWe recently updated our gorm dependency and...

Gorm An error occurs in a multi-coroutine scenario

I have started a program with many coroutines. In this case, when my gorm has been executed for a period of time, it ret...

Gorm how to get addr(ip adn port) from a gorm.DB value

Your QuestionThe document you expected this should be explainedExpected answerI use "db.Callback().Query().After("gorm:a...

Gorm Join with preload does not work as intended

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/748DescriptionThe issue in https://github.com/go-gorm/gor...

Gorm (v1.25.5) Why gorm:"uniqueIndex:idx_xxx" generate two unique index "idx_xxx" and "xxx" ?

Your QuestionMy model: type ToolRelation struct { gorm.Model TeamId int64 ProjectId int64 DepotId in...

Gorm Query Operation in After Update Callback Causes RowsAffected to be 0

I encountered an issue while using GORM for update operations. I registered an after update callback function that inclu...

Gorm How to modify sql before execute it and after build it?

Your QuestionI want to modify sql which created by gorm before executed. How can I do?I tried to create a "before" callb...

Gorm cannot find encode plan

type Streaming struct { RoomID string `gorm:"primaryKey"` Title string `gorm:"not null...

Gorm Gen 根据 PostgreSQL 数据库表生成 model 的时候,有指定空字符串默认值的字段,生成的 gorm 标签有问题。

比如某个article表的title标题字段,数据库指定空字符串默认值,Gen 生成 model 的时候,gorm 标签如下:Title string gorm:"column:title;type:chara...

Gorm gorm can't support doris?

Your Questionmy code: var ad FlowAdUrlStat stmt := db.Session(&gorm.Session{DryRun: true}).Where("opt_YYY...

Gorm Proposal: Enable Optional Use of AutoMigrate via Modular Plugin System

Describe the featureThe proposed feature involves refactoring the AutoMigrate capability in GORM to operate as an advanc...

Gorm gorm 支持golden db

Describe the featuregolden db 的查询兼容mysql, 是没有问题的,但是goldendb对于不同的查询方式,返回的column有的是大写,有的是小写导致不论struct里面column配置大写还是小写,都有一部...

Gorm PostgreSQL how to check if returned error is "Violates foreign key constraint" in GORM?

Though I can check with the postgres returned error code but I don't want not to depend on postgres database and would l...

Gorm 多对多关联模式下,不能对中间表的id或其它条件进行排序

GORM Playground Link版本:gorm的最新版。Description场景:1. 有一相册表,里面有很多的图片。2. 有一个产品表,封面图字段可以选择多张图片,每个图片可以被不同的产品选择。当用多对多的关联模式时,会产生一个...

Gorm breaks 1.21 to 1.22

insertData := map[string]interface{}{...}gorm.... Table("transaction_history"). Create(insertData).Error...

Gorm 为什么find函数里必须传入slice的指针呢,slice本身不就是引用类型吗

slice本来就是引用类型,为什么还需要传入指针var students []dao.Studentdb.Find(students)这样写会爆错var students []dao.Studentdb.Find(&students...

Gorm Schema missing when MERGE is executed using Save() method.

Discussed in https://github.com/go-gorm/gorm/discussions/7032Originally posted by **sanjeevrayasam** May 22, 2024I have ...

Gorm Scopes are not processed when evaluating Join conditions

Playground Pull Request Linkhttps://github.com/go-gorm/playground/pull/743DescriptionWhen using Joins/InnerJoins, there ...

Gorm Question About Composite Index

Your Questiontype BaseModel struct { ID uint `gorm:"primaryKey` CreatedAt time...

Gorm db.Save updates CreatedAt with a zero value.

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/742Descriptiondb.Save updates CreatedAt with a zero value...
上一页 下一页
.