Nineya
Home
Blog
软著申请
Gorm Find执行多次,会把sql拼接
2025-01-14 08:23:36
1484
我在循环里面查找数据,为什么把上一次的in条件会拼在一起?我想要的是每一个都新的单独查询,用什么方式。code:for _, userGroup := range userGroups { users := make([]*model...
Gorm batch update by object list
2025-01-14 08:23:33
445
Your Questiongorm version: gorm.io/gorm v1.20.6I want to batch update some fields of the object list. Like:model.objects...
Gorm How to join table and return data in JSON format
2025-01-14 08:23:31
4290
How to join table and return data in JSON formatI have two tablestype Menu struct { ID int gorm:"pri...
Gorm 求助一个问题:关于1对多表时候,如何双向索引对方?
2025-01-14 08:23:28
745
Your Question比如:// User 属于 Company,CompanyID 是外键type User struct { gorm.Model Name string CompanyID int Company...
Gorm db.AutoMigrate(&MyTest{}) 时会报错
2025-01-14 08:23:24
2373
背景信息:go:1.18gorm:1.23.8sqlite3结构体如下type MyTest struct { Name string `gorm:"default:中文"` gorm.Model}在首次运行...
Gorm [Bug] Got wrong value in Find/Scan with JOIN and same column name
2025-01-14 08:23:21
3035
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/516DescriptionGot wrong value in Find/Scan with JOIN and ...
Gorm Performing multiple migrations ends up in prepared statement cache error
2025-01-14 08:23:19
1313
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/523DescriptionWhen Prepared Statements are enabled in gor...
Gorm gorm.v1 一个字段上定义多个联合索引tag,只有一个生效
2025-01-14 08:23:14
3014
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Description版本V1Model定义如下:type Demo struct { ID ...
Gorm SqlServer scan rows to map[string]interface,type DECIMAL is string
2025-01-14 08:23:11
4121
GORM Other Playground Linkgo-gorm/playground#337SqlServer: scan rows to map[string]interface,type DECIMAL is string and ...
Gorm Is there a way to use GROUP BY truncating a DATE field?
2025-01-14 08:23:08
1010
Your QuestionI'm trying to use the Count finisher in order to get the amount of rows by day. The problem is that the col...
Gorm when the data is empty, json parsing fails !!
2025-01-14 08:23:05
1720
type AppLoginLog struct { Id uint `gorm:"column:id;" json:"id"` Json...
Gorm Creating models does not work
2025-01-14 08:23:03
1603
Hello,I have some code to create a todo. but it doesnt work.type Todo struct { ID uintgorm:"primary key;autoIncrement...
Gorm 批量插入生成的SQL报错
2025-01-14 08:23:00
662
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionComment From: github-actions[bot]The issue ha...
Gorm Plan for migration generation tool
2025-01-14 08:22:57
6590
Describe the featureIs there any plan for creating a tool to generate migration files from DB (just like django does) to...
Gorm 插入数据,如何获取自动递增id?
2025-01-14 08:22:55
170
Your Question通过map[string]interface{}插入数据,如何获取自动递增id有没有比较简单的方法实现The document you expected this should be explainedExpect...
Gorm Logger shows invalid log (only the log is wrong, the insertion is fine)
2025-01-14 08:22:52
2124
Logger shows invalid log (only the log is wrong, the insertion is fine)When I try to insert a user with lots of fields, ...
Gorm mysql 连接池设置了连接可复用最大时间时,超出时间的连接并没有被close掉
2025-01-14 08:22:49
2198
`// 获取通用数据库对象 sql.DB ,然后使用其提供的功能sqlDB, err := db.DB()// SetMaxIdleConns 用于设置连接池中空闲连接的最大数量。sqlDB.SetMaxIdleConns(10)// Se...
Gorm SetColumn doesn't work as expected in BeforeSave and BeforeUpdate hooks
2025-01-14 08:22:46
3398
Hi jinzhu,i'm experiencing a problem with setting values using the BeforeSave and BeforeUpdate hooks while updating the ...
Gorm gorm connet mycat get text value question
2025-01-14 08:22:43
654
when i use gorm connet mycat, get the text field value is incorrectComment From: github-actions[bot]The issue has been a...
Gorm Official documentation has errors
2025-01-14 08:22:41
771
The tag in the source code is primarykey refer to https://github.com/go-gorm/gorm/blob/master/model.goBut in the documen...
上一页
下一页
1
…
974
975
976
977
978
…
2246
.