Gorm Json.RawMessage and Mysql

QuestionHello, I just want to save data from golang using gorm to my mysql database, In this case, this is my struct: ty...

Gorm AutoMigrate will create many indexes of the same field

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionAutoMigrate会创建很多个同字段的索引,如下图所示AutoMigrate will...

Gorm Delete Polymorphic with Select cannot access in BeforeDelete Hook

I have 2 models as below:type Banner struct { Base Description string `json:"description"` Link...

Gorm how to delete object with self-referenced objects

Discussed in https://github.com/go-gorm/gorm/discussions/6344Originally posted by **pplmx** May 22, 2023if there is a st...

Gorm Questions about the common use of GenerateModel and GenerateAllTable

I have multiple tables and I want to customize the fields for certain tables during generation. There may be duplicate o...

Gorm BeforeSave is executed twice in transaction

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/593DescriptionWhen you save a model which BeforeSave is i...

Gorm AutoMigrate not creating constraints properly

I'm running AutoMigrate on this model but it is not working properly:type BrandMemoryContent struct { gorm.Model C...

Gorm Order() function call makes query execution about 1000 times slower.

Your QuestionHaving .Order() function call slows down query execution by 1000x timeWe have the code that is something li...

Gorm TestDialectorWithErrorTranslatorSupport fatal message error

DescriptionHi, Maybe the fatal message is error?https://github.com/go-gorm/gorm/blob/001738be49d26d341f88377d6006356573c...

Gorm GORM不执行查询

db.Ping和db.Stats()以及数据库连接的单例模式结果如下func GetInstance() *gorm.DB { host := viper.GetString("mysql.default.hostname&...

Gorm Belongs to foreign key field name cannot be equal to primary key of assigned struct

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/467DescriptionUsinggithub.com/golang-sql/civil v0.0.0-202...

Gorm mysql query error

{"time":"2023-05-19T10:02:32.4227988+08:00","level":"-","prefix":"echo","file":"recover.go","line":"113","message":"[PAN...

Gorm feat: add doc for association unscoped

Describe the featureadd doc for association unscopedMotivationWelcome to submit PR in go-gorm/gorm.io to help us improve...

Gorm Rename License to LICENSE

Describe the featureRename the license file from License to LICENSEMotivationLICENSE is the standard. A lot of tooling i...

Gorm Bitmap indexes for Postgres

Your QuestionI saw in the docs that we can set the type of indexes. As we want to use an index on a low cardinality fiel...

Gorm Sqlite: delete missing where clause when unique key present

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/599DescriptionI have a simply master/detail structure:typ...

Gorm Create has many relationship with multiple tables

type User struct { gorm.Model Name string CreditCards []CreditCard `gorm:"foreignKey:ReferrerID&quo...

Gorm How to get the query statement

Your Questiondb.Statement.SQL.String() and db.Statement.Vars is always empty, is there any way I could get the raw state...

Gorm How to make composite join work?

Your QuestionIn composited model, like below:type Thing1 struct { Id1 uint `gorm:"primarykey"` Name s...

Gorm Auto associations causes strange sql errors

Your QuestionThis query generates error sql and cannot work anyway. I use AutoMigrate to create the tables.type UserGrou...
上一页 下一页
.