Gorm Gorm hooks BeforeUpdate and BeforeSave always works after every hook

Your Questionis there any solution to disable BeforeUpdate and AfterUpdate hooks, because this hooks always works after ...

Gorm Is there a way to make gorm send database specific values for created_at, updated_at and deleted_at fields?

Your QuestionI have one instance of Postgres DB, and several instances of my app running simultaneously. It is possible ...

Gorm Don't upsert when Create Association

Your QuestionHi thanks for the great library!I've looked for a while for the same question but haven't found anything. I...

Gorm 连表查询如何统计总数?

Your Question`db.Model(model.Banners{}).Count(&total) //这么写的话会报 s.* 字段不存在s.data.DB.Model(&model.Banners{...

Gorm sqlite3 string primary key suddenly has data type int

Your QuestionI'm using gorm with sqlite3 which worked fine. Now I suddenly got the error data type mismatch, then I look...

Gorm How can I remove all data generated with a test once the test finishes?

Your QuestionI'm trying to write a test suite with gin and gorm. The problem I am facing is that tests leave behind data...

Gorm 仅创建已经存在的外键关联关系

Describe the feature当我保存一个存在外键关系的表,如果我设置了外键关系,目前默认会创建不存在的外键项,然后再进行关联,现在我想问下是否可以只关联已经存在的项,而不去创建新的关联项。例子如下:type User struc...

Gorm composite primary key does not work as expected

h2. modeltype PriceDaily struct { Product string `gorm:"primaryKey"` Date string `gorm:"primaryK...

Gorm update only changed field when Save()?

Your QuestionI have a big table which have many columns, each time I update some fileds and call Save(), all fields are ...

Gorm The logic of automatic migration is not rigorous

GORM Playground Linksorry, the project is urgent so I don't have time, I'll try to make it clearAnd I found the code for...

Gorm ORDER and vars

Your QuestionI would like to perform a request in the form of:SELECT … ORDER BY ts_rank(ts, to_tsquery('english', 'torna...

Gorm gorm cant detect proper foreign key in case of field embedding

https://github.com/go-gorm/playground/pull/414Hi, gorm cant detect proper foreign key in case of field embedding.How to ...

Gorm Help with this query with subquery

I`m trying to mount this query but not getting it. Can someone help? WITH teste as ( SELECT cb.title, cb.amount, count(c...

Gorm gorm.io/gorm v1.23.0使用plugin/soft_delete报错

go.mod: gorm.io/driver/mysql v1.3.0 gorm.io/gorm v1.23.0 gorm.io/plugin/soft_delete v1.0.5go build:gorm.io/plug...

Gorm unanticipated error with context canceled

in gorm v1.22.4 , stress test my services.it still reutrn unanticipated error when context canceled, suchsql: transactio...

Gorm support scanner/valuer in tags

Describe the feature能否在 tags 里指定 scanner/valuer 或者 dataType。这样对于复杂的类型,就不需要每个都实现这些接口了。比如type User struct {Interests []str...

Gorm Gorm slow when querying 4000+ rows

Your Questionversion: v1.22.4I have a query which is not slow when I use explain analyze in pgsql:pgsql=> explain ana...

Gorm Getting Data race gorm.RegisterDialect/gorm.newDialect()

Hello,Encountered an issue while running test code, getting data race as following[2022-02-11T13:11:38.067Z] WARNING: DA...

Gorm how to get insert id when we use Raw for complex insert sql

Your Questionhow to get insert id when we use Raw for complex insert sql?err := dl.db.Transaction(func(tx *gorm.DB) erro...

Gorm Is there an an Include function (opposite of Omit) ?

Your QuestionIs there an opposite to Omit? Pretty much every server will have a User model with a password field. Usual...
上一页 下一页
.