Nineya
Home
Blog
软著申请
Gorm when struct table dependent on its value, TableName method is invalid
2025-01-15 00:34:03
860
GORM Playground Linki have a struct type Logs struct { ID int64 gorm:"id" Content string gorm:"content" LogTime int64 go...
Gorm 我希望在gorm执行某些sql语句时,如果发生异常,则将执行的SQL打印到日志中
2025-01-15 00:34:00
983
我希望在gorm执行某些sql语句时,如果发生异常,则将执行的SQL打印到日志中我的代码如下示例result := db.Find(&regionModels)if err := result.Error; err != nil {...
Gorm string in 'numeric' field
2025-01-15 00:33:58
1027
Intentionally no playground link.gorm puts a string such as "true" in a SQLite 'numeric' field when mapping a go bool an...
Gorm the field which is selected can not be updated
2025-01-15 00:33:55
671
just as the pictures, the filed using_assistant is selected, but it count be updatedComment From: github-actions[bot]The...
Gorm Is there a unit test coverage for gorm?
2025-01-15 00:33:42
761
Hi,We are investigating gorm and considering using it, just wondering what is the current test coverage of the code base...
Gorm 在使用SQLlite数据库进行AutoMigrate时,ID属性无法设置auto_increment
2025-01-15 00:33:39
1196
Your Question我在使用自动创建表的功能时,对所有表的ID属性需要设置自增,我创建了一个根结构体type Model struct { ID uint `json:"id" gor...
Gorm Why uint instead of int?
2025-01-15 00:33:33
1220
I can see that gorm.Model is:type Model struct { ID uint `gorm:"primarykey"` CreatedAt time.Time ...
Gorm How to create foreign key for embedded hasmany relation during migration?
2025-01-15 00:33:30
1605
Your QuestionHow to create foreign key for embedded hasmany relation during migration? For example:type VirtualMachine s...
Gorm gorm的hasIndex函数获取不到阿里云PolarDB-X 2.0的表内的索引
2025-01-15 00:33:28
752
在使用casbin v2.71.1 和casbin/gorm-adapter/v3 v3.18.0的时候,数据库使用的是阿里云PolarDB-X 2.0 mysql ,在调用到hasIndex函数的时候查询不到唯一索引的存在下边是我手动查询...
Gorm How to target a different model (in other word, table) once a global hook is triggered?
2025-01-15 00:32:36
6410
Your QuestionWhen a hook registered at global is triggered, it seems the db object is scoped to the impacted model only....
Gorm Regression using Find and Updates
2025-01-15 00:32:33
344
https://github.com/go-gorm/playground/pull/655DescriptionI upgraded from 1.24.6 to 1.25.5 and some of my gorm queries ar...
Gorm db.Order(gorm.Expr(" id, ?", IDs)) // sql expression
2025-01-15 00:32:31
1022
GORM Playground Link在原来 github.com/jinzhu/gorm 的项目中有db.Order(gorm.Expr("id, ?", []int{1, 2, 3})) // sql expression这样的一种写...
Gorm if table field created_at have a default tag ,gorm will not auto fill value
2025-01-15 00:32:28
1121
type TableTest struct { Id int64 `gorm:"column:id;primary_key;AUTO_INCREMENT" json:...
Gorm ErrRecordNotFound not work for Find()?
2025-01-15 00:32:26
5820
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/573run test code below can reproduce thisDo I miss someth...
Gorm same filed different type on scan
2025-01-15 00:32:23
376
Your QuestionI have two table,same filed same go enumExpected answerwhen i do query.first table src is []byte.so case fa...
Gorm Concurrent AutoMigrate
2025-01-15 00:32:12
787
Your QuestionI want to know such a thing.I am developing a service and I use AutoMigrate at startup (I can't during pipe...
Gorm Unexpected TableName parsing behaviour
2025-01-15 00:32:10
2500
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/648DescriptionWhen gorm parses the table names from the m...
Gorm Can't Insert correct boolean when default is true
2025-01-15 00:32:07
2682
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Descriptionboolean value can't conver to correct value w...
Gorm 一个表有若干字段,每次更新不一定更新某几个字段,如何实现增量更新?
2025-01-15 00:32:04
571
Your QuestionThe document you expected this should be explainedExpected answerComment From: wxy2077问题描述太少了,没有例子,是我理解的这个意...
Gorm Create table based on struct
2025-01-15 00:32:01
1009
Your QuestionHello there. I would like to know if there is a way to create a object table based on struct with gorm.The ...
上一页
下一页
1
…
938
939
940
941
942
…
2246
.