Gorm offset and limit working unexpectedly, resulting limit 0 in compiled SQL

Environmentgolang version: 1.18gorm version: v1.24.3ProblemWe've been using gorm in our production environment. Recently...

Gorm Checking which key is duplicate, in case of a ErrDuplicateKey error

Your QuestionIs there a way to check which key was duplicate, in case of a ErrDuplicateKey error?The document you expect...

Gorm Preload data from interface given in func

I have the following structs:type User struct { gorm.Model Username string Orders []Order}type Order struct { gorm...

Gorm 关于引号,反引号的建议

Describe the feature张⾦柱大佬好,自学小白一枚,看了半天,搜了半天也没理解为何 ? (就是where("name = ?",name)) 除了int一定要给加单引号。是为了防止注入?我的情况是这样的,一个更改状态的语句(...

Gorm Scan after using Scopes function panicks if *gorm.DB object is used for fetching other data.

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/577DescriptionWe currently use the Scopes function, admit...

Gorm type标签无法指定time类型?

通过type标签指定At为Time类型:type Test struct { At string `gorm:"type:time"`}但AutoMigrate时却使用了datetime类型:[3.979ms] [...

Gorm Embedded nil pointer structs should be retrieved as nil

Describe the featureGorm should round trip an embedded pointer to a struct as nil when the struct is given as nil.Motiva...

Gorm Omit has-many association without zeroing the value

Your QuestionHello,I'm trying to omit has-many association, without zeroing the value of the field (so I would get the e...

Gorm If the created_at field is not added, the db.Save() function will continue to perform insertion operations.

GORM Playground LinkThis is a fake URL to prevent this bug from being overlooked: https://github.com/go-gorm/playground/...

Gorm Allow column to be created but not altered on migration

Describe the featureI would like to specify a column to be created when auto migration run only if the column does not y...

Gorm Backreference, will ignore my custom join table

Backreference, will ignore my custom join tablemany2many When many2many customizes the join table, if it is backreferenc...

Gorm Sometimes Error is "<nil>" instead of nil

Your Questionif res = db.Save(&amp;msg); res.Error != nil { log.Error(err) return}I have simple code which is upda...

Gorm SQL Error when select multiple fields with ?

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionCode:query := db.Model(&quot;table_name&quot;...

Gorm Many2Many fails when Creating object that uses UUID for ID

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/588DescriptionWhen the primary key is a UUID that is gene...

Gorm record not found error in the log should not be warn level

record not found error in the log should not be warn levelDowngrade the "record not found" to info or debug levelThe "F...

Gorm Automatically analyze the number of batches in CreateInBatches

Describe the featureI would like the number of batches in CreateInBatch to be automatically set appropriately based on t...

Gorm Change Dialector with dbresolver

Your QuestionHello, we encountered one use case where we want to change the dialector temporarily with dbresolver along ...

Gorm tx.where()

我在查询mysql的时候 where条件中 只要加上日期条件,就得到下面的报错信息。 code: 48. db::exception: command  is not implemented我用别的字段当条件 则没有问题。 tx :...

Gorm Preload nested with reference to parent

I would like to use preload with reference to the parent, but it seems impossible. So I got something like this, nothing...

Gorm AutoMigrate with Many2Many fails when using UUID for ID

GORM Playground Linkhttps://github.com/shi-rudo/playground-1https://github.com/go-gorm/playground/pull/474for the sake o...
上一页 下一页
.