Nineya
Home
Blog
Gorm RowsAffected is incorrect on subsequent updates on mysql
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/793DescriptionExecute an update Exec against a supported ...
2025-03-12 14:08:44
7698
Gorm Batch Create on sqlite causes a panic if a *map[string]interface{} is passed a parameter to Create
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/795DescriptionBatch Creates on sqlite causes a panic if a...
2025-03-12 14:08:28
177
Gorm JSONArrayQuery when contains a slice (in golang), which created extra parentheses
GORM Playground Linkhttps://github.com/gwsee/golang-example/blob/main/main.gohttps://github.com/go-gorm/playground/pull/...
2025-03-03 14:02:30
1194
Gorm JSONArrayQuery when contains a slice (in golang), which created extra parentheses
https://github.com/gwsee/golang-example/blob/main/main.goDescriptionthe mysql column area type is json;here is a simpl...
2025-03-03 14:02:18
1173
Gorm PostgreSQL does not return expected timezone
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/790DescriptionWith the database server configured for UTC...
2025-03-01 14:03:31
590
Gorm Creating multiple objects referencing a shared object results in that object getting created multiple times
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/788DescriptionI use the terms from the playground to expl...
2025-02-04 14:08:28
1492
Gorm Unable to use netip.Addr in models
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/786DescriptionSince (if I understand correctly) GORM uses...
2025-01-26 14:01:08
916
Gorm BeforeFind
Describe the featureCreate a BeforeFind hook along the same lines as the other Before hooks, but for Find.MotivationWe a...
2025-01-25 14:01:56
497
Gorm 设置 RaiseErrorOnNotFound 不生效
版本:v1.25.12参考 #6105 中的方法进行设置后,使用 Find 查询依然无法触发 ErrRecordNotFound 错误 gormDB, err := gorm.Open(mysql.New(mysql.Conf...
2025-01-23 14:03:36
2256
Gorm 如果构建一个ifnull(表1.字段,表2.字段)表达式
Your Question在left join中,获取字段,需要实现ifnull(表1.字段,表2.字段)功能,但是目前只有ifnull()函数,指定具体数值,如何实现本功能?The document you expected this s...
2025-01-23 14:03:30
196
Gorm 如果构建动态复杂查询语句
Your Question检索条件 左侧分类 and (名称 or 编码 or 型号) ,如果名称、编码、型号有任意值,在构建检索条件,否则不进行检索,这样动态的查询语句如果构建?如可能会出现如下情况:分类=90 and (名称 li...
2025-01-23 14:03:24
288
Gorm Where builder not wrapping parentheses around multiline string clauses
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/784DescriptionAt some point in the last few releases, I t...
2025-01-23 14:03:09
694
Gorm Deadlock on sqlite with PrepareStmt = true
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/783DescriptionRequirements:- using sqlite- setting sqlDB....
2025-01-23 14:03:03
641
Gorm Sqlite 在执行AutoMigration时候,如果tag中指定了索引名称,会导致不同表执行生成同样的索引名称然后报错
example: https://github.com/go-gorm/playground/pull/782package maintype Order struct { ID uint64 `gorm:"col...
2025-01-16 16:48:38
1751
Gorm *string and *int cause left join not to return nil
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/781DescriptionI have two model structs. When I combine th...
2025-01-15 04:27:03
3021
Gorm Why is there an extra insert query running for updating Many to Many field updates?
Why is there an extra insert query running for updating Many to Many field updates? [check the second last INSERT query]...
2025-01-15 04:27:01
2938
Gorm Why update by map do not run Value() (driver.Value, error)
Why update by map do not run Value() (driver.Value, error) function?db.create() will run the function.Comment From: gith...
2025-01-15 04:26:58
689
Gorm invalid value, should be pointer to struct or slice
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/662DescriptionAfter adding BeforeSave hook, updating mode...
2025-01-15 04:26:55
2090
Gorm Many2Many with custom join table gets converted to snake_case when with TableName() function
Your QuestionUnable to set custom many2many table, always gets converted to snake caseThe document you expected this sho...
2025-01-15 04:26:53
2090
Gorm 如何全局禁用掉关联表数据的默认写和删除操作
Your Question在我目前的项目里,会需要使用 Preload Joins 这样的方法,但是确实不需要写操作的时候也去处理关联数据,所以我期望能全局禁用掉这个默认或者非默认行为,防止团队成员使用导致非预期错误。经过调研,找到了三种方...
2025-01-15 04:26:50
1483
上一页
下一页
1
2
3
4
5
6
7
…
101
.