Gorm Can't create foreign key for one to one relationship on PostgreSQL

I have below two structs where the Student and the StudentCard has a one to one relationship:type Student struct { go...

Gorm 如何在不使用中间表的情况下实现一对多

用一个字段使用json或varchar存储另外一张表的多个主键。如何实现has many或many2many的关联操作Comment From: github-actions[bot]The issue has been automatic...

Gorm When only ID is used as the primary key, the save method will insert a record without any data changes

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Descriptiongorm v1.25.1 Prerequisite:Execute the save op...

Gorm gorm 1.25.5 use ? Placeholder query for doris reports error, then works fine with springboot+mybatis-plus

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Descriptiongorm query doris (use prepared statement)im...

Gorm gorm 1.25.5 db.First(&md, 1).Error,有bug,底层sql条件会变成一个数组,如select * from xx where id = "[1]",无法查询

gorm 1.25.5 db.First(&md, 1).Error,有bug,底层sql条件会变成一个数组,如select * from xx where id = "[1]",无法查询Comment From: github-a...

Gorm how to setting where condition position in preload?

tx.Model(&models.Cart{}).Preload("Items").Find(&lists)select * from cart_items where cart_id in (xxxx)...

Gorm occured panic when starting a transaction to work

DescriptionWhen I used gorm to start a transaction to update the database, Panic occurred. The specific reasons are anal...

Gorm [warn]duplicated callback, register a new call before query, will warn this log

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Descriptionwhen i register the new callback, will log th...

Gorm Versatile smart select fields for relations

Describe the featureIm often missing smart selecting fields in relations, so I don't have to load the whole model.This w...

Gorm create a record failed

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/680DescriptionI am not good for gorm. but i think it's a ...

Gorm GORM generates invalid SQL for sqlserver when deleting with composite primary keys

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/679type MultiTable struct { Field1 string `gorm:"...

Gorm 使用Debug打印时Group Where失效

使用Debug打印时Group Where失效我的链式调用如下,使用了Group Where来编写复杂的sqlerr := db.Where( db.Where("channel = ?", constants.CouponC...

Gorm 我在数据库中的数据类型是 decimal(10,2),运行自动迁移设置成decimal(10,4),但是并没有如常所愿

type Tablex struct { Age decimal.Decimal `json:"age" gorm:"column:age;type:decimal(10, 4)"`}func ...

Gorm Defining Model for CockroachDB

Your QuestionI am using cockroach db with gorm.type Base struct { ID uint `gorm:"primary_key...

Gorm Updating struct value in BeforeUpdate() does not use new value in query

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/678DescriptionI would like to be able to use BeforeUpdate...

Gorm Using unscoped when hard deleting an association or appending does not work as expected.

Your QuestionHello there, I cannot make this work for some reason, i have checked some issues and it looks like the unsc...

Gorm Wrong foreignKey setup for multiple embedded belongs-to relations of same type

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/672Descriptioncnp from the playground PRWhen using multip...

Gorm Bad insertion IDs when doing a bulk Upsert

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/658DescriptionWhen bulk inserting rows with a OnConflict ...

Gorm Running two creates with ON CONFLICT set causes a panic

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/663DescriptionWhen using the OnConflict handler, if you r...

Gorm Composite Primary Key should understand field priority like unique index

Describe the featureComposite Primary Key should understand field priority like unique index.https://github.com/go-gorm/...
上一页 下一页
.