Gorm db.Save creates record even when it has its primary key set

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/166DescriptionPer documentation, Save should insert a rec...

Gorm Is it possible to add two values in an OnConflict clause in GORM?

Your QuestionLooking to do something likeINSERT INTO `table` (...) VALUES (...) ON DUPLICATE KEY UPDATE `points`=`points...

Gorm 用tag指定数据库字段为int类型的字段默认值时,create函数生成的sql语句多了一列

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionComment From: github-actions[bot]The issue ha...

Gorm Create/Save failed with default values

Regard to #5538, clarify testing below:func TestIssue5538(t *testing.T) { type Policy struct { gorm.Model ...

Gorm Panic when using gorm many2many relationship with model that uses go generics

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/618DescriptionAlthough gorm is based on Go 1.16 it appear...

Gorm Is gorm still maintained?

Is gorm still maintained? Why don't many of the many table query questions about many2many mentioned above have a best a...

Gorm big bug

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionComment From: xiyang-2023Scopes v1.25.1 is no...

Gorm references happend Error

Your Questionpackage mainimport ( "gorm.io/driver/mysql" "gorm.io/gorm")type User struct { ...

Gorm open sqlite fail,need close?

Your Questionopen sqlite fail,need close?gorm.Open sqlite failed,error is 'got error unable to open database file: not a...

Gorm order by id asc 取最新问题

Your Question如题,我司将 mysql 数据库当了时序数据用,数据简化结构包含了 id(自增主键,int),deviceID(设备ID,varchar(255)), value(值,varchar(255)),createTim...

Gorm [MSSQL] Can't insert when there is a trigger on the table

Your QuestionI'm trying to insert some values using the Create functions but, since there's an indication about the Prim...

Gorm Only log write queries (e.g. CREATE, UPDATE, DELETE)

Your QuestionIs there a way to only log certain queries? In particular, I only want the logger to log statements that mo...

Gorm tidb 开启事务耗时近1s

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Descriptioncode: log.Infof(ctx, "timeConsuming before, t...

Gorm How to query a many2many relationship with a Where clause on the association?

Your QuestionI have the following entities:type User struct { ID string Name string Groups []Group `gorm:"...

Gorm 事务提交有延迟?

我在调用Commit之后,同一秒执行select还是没查询到commit提交的插入数据的事务,要过一下下,这个是不是异步操作的?Comment From: w1ndyz我在调用Commit之后,同一秒执行select还是没查询到commit...

Gorm panic: runtime error: invalid memory address or nil pointer dereference

At v1.25.1 version, The wrong dns will painc.gorm.Open( mysql.New(mysql.Config{ DSN: "test", }),)...

Gorm need close?

gorm.Open sqlite failed,error is 'got error unable to open database file: not a directory'Do you need to call the closin...

Gorm automigrate with many2many is easy to make mistakes #615

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/615Description所有的信息都在上面的那个pr中,其中最主要的就是以下代码:func TestGORM(...

Gorm Not auto migrate primaryKey for sqlite

I added a column to the primary key, but the automatic migration did not take effect.befortype ComicViewLog struct { ...

Gorm [gorm >= 1.25] save() is successfully applied with a record that has a foreign key soft deleted

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/610DescriptionThis bug is happening only on gorm >= 1....
上一页 下一页
.