Nineya
Home
Blog
软著申请
Gorm Inconsistent default value check between MySQL and MariaDB
2025-01-14 08:09:51
1457
Consider the following schema:type User { ID string `gorm:"primary_key"` Name string `gorm:"unique&...
Gorm goroutines环境下,运行一段时间后,单表查询的结果不对
2025-01-14 08:09:49
806
Your Question在多goroutines环境下单表查询,运行几个小时后,修改某个数据,查询能返回正确的值,继续再运行几个小时,再次查询,返回的数据跟表中数据不一致(中间没有再修改数据)In the multi goroutines...
Gorm 想问一下,当定义指针类型的struct变量,查不到数据,是否不用将变量初始化成 empty struct
2025-01-14 08:09:46
4105
想问一下,当定义指针类型的struct变量,查不到数据,是否不用将变量初始化成 empty struct。empty struct和查不到数据是两个概念。比如定义 var s *structFind在查不到数据的时候会返回empty str...
Gorm Is there a way to get the executed SQL statement directly?
2025-01-14 08:09:43
1378
Your QuestionFor example: models.db.save (& user) I want to get the executed SQL statement. Is there any way...
Gorm Nested transactions don't work with manual transaction begin/close functions
2025-01-14 08:09:41
1988
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/482DescriptionIt appears that nested transactions aren't ...
Gorm 表关联
2025-01-14 08:09:38
2223
我创建了一个模型类,希望可以希望可以和其他表关联起来。我的字段名创建的是Id,但是在通过这个字段查询的时候,是查不到了,会提示 *Error 1054: Unknown column 'user_permissions.UserId' in...
Gorm How to change the generated SQL for CREATE TABLE.
2025-01-14 08:09:34
1189
Your QuestionTrying to enhance the gorm-firebird driver from “github.com/flylink888/gorm-firebird”. Running the tests ag...
Gorm Frequency for new tag release
2025-01-14 08:09:31
278
Your QuestionHow often we have a new tag release to get the latest changes ?Comment From: jinzhuQuite depends on how man...
Gorm many2many 关系表, 在Preload的时候,没有使用中间表的deleted_at
2025-01-14 08:09:28
463
Your Question类似如下三张表type User struct{ gorm.Model Resources [] Resource gorm:"many2many:user_languages"}type Resource s...
Gorm undocumented breaking change in gorm v2, the value of the ignored field gorm:"-" in struct is not updated when use Update().
2025-01-14 08:09:26
2319
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/480DescriptionIn gorm V1 , the value of the ignored field...
Gorm Delete nested data with GORM.
2025-01-14 08:09:23
5365
Your QuestionI have a nested schema. The nested relationships are many-many relationships.How do I delete nested the dat...
Gorm key field
2025-01-14 08:09:19
972
I have a field in my MySQL database called key.My code: ... .Where("key = ?", key) ...Unfortunately the generated sql do...
Gorm Using 'group' as column name breaks queries with Where
2025-01-14 08:09:17
1104
Go 1.13.7 - Postgres 12.2Just wanted to report, I had a structtype User struct { gorm.Model Group uint Name uint}and ...
Gorm gorm v1 and v2 is incompatible (db=db.Where())
2025-01-14 08:09:14
796
Your Questionv1:v2: v2 result:{"level":"DEBUG","time":"2022-05-30 17:40:29","caller":"mysql/user.go:17","message":"Datab...
Gorm feat: custom log sql generation function
2025-01-14 08:09:08
1713
custom log sql generation functioncustom log sql generation functionchange Logger Interface Trace Methodnow :type Interf...
Gorm After update, the value of the ignored field gorm:"-" in struct is not updated
2025-01-14 08:09:05
765
Your QuestionIn gorm V1 , the value of the ignored field gorm:"-" will changed after updatetype User struct { gorm.Mo...
Gorm How to automatically create tables with different table names in the same model
2025-01-14 08:09:03
1071
Your QuestionWhen I use the same model to create tables with different table names like in the example belowvar tableTpl...
Gorm AutoMigrate / PrepareStmt fails with sql: expected 0 arguments, got 1
2025-01-14 08:09:00
306
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/479DescriptionSince v1.3.6 of gorm.io/driver/postgres Aut...
Gorm sql: Scan error on column index xxx, name "id": destination not a pointer
2025-01-14 08:08:58
6360
Your QuestionI have a couple of Models such asTag struct { gorm.Model Name string `gorm:"not null;uniqu...
Gorm How to make gorm respect the default value defined in table DDL?
2025-01-14 08:08:55
1152
Your QuestionAssuming we have the following table created in a PostgreSQL database:CREATE TABLE users( id BI...
上一页
下一页
1
…
987
988
989
990
991
…
2246
.