Nineya
Home
Blog
软著申请
Gorm Unnecessarily unique indexes created when running AutoMigrate
2025-01-15 02:23:45
3068
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/589DescriptionModel User has only one field Name, with un...
Gorm Refactor: Distinguish between unique and UniqueIndex
2025-01-15 02:23:42
4150
Describe the featureDistinguish between unique index and index to better support them.MotivationBecause we can't disting...
Gorm How to properly BEGIN EXCLUSIVE TRANSACTION using sqlite driver?
2025-01-15 02:23:39
653
Your QuestionWhat is the proper way to run BEGIN EXCLUSIVE TRANSACTION when using sqlite?The database/sql package doesn'...
Gorm Error in GORM migration: GuessConstraintInterfaceAndTable undefined
2025-01-15 02:23:37
3995
When attempting to run my Go application with GORM using the PostgreSQL driver, I encountered the following error:# gorm...
Gorm Many2Many on existing db entities empty
2025-01-15 02:23:30
2417
Many2Many on existing db entities emptyThe database and the table exist. Migrations and management remain in the third-p...
Gorm 测试default时的错误
2025-01-15 02:23:26
1377
当我测试gorm文档中的default标记时,创建数据表报错:type User struct { ID string gorm:"default:uuid_generate_v3()" // db func Fi...
Gorm FirstOrCreate 后调用 Save 提示 Duplicate entry '2' for key 'help_relation.PRIMARY'
2025-01-15 02:23:23
4406
var info models.HelpRelation // 关系 err = p.DB().Debug().Model(&info). Where(models....
Gorm MySQL-描述表的结构体,给其属性添加autoIncrement 执行AutoMigrate()方法 数据库会新建一个索引
2025-01-15 02:23:20
1311
我的结构体节选type Site1 struct { ID string gorm:"size:25" SerialNo uint32 gorm:"column:serialN...
Gorm the output of .Debug() for UUID binary(16)
2025-01-15 02:23:15
1100
Your QuestionI use MySql binary(16) to store UUID generated from google uuid pkg. When under '.Debug()' mode, like db.De...
Gorm fatal error: concurrent map writes
2025-01-15 02:23:13
730
Description极端情况下会触发map的并发写panic, 代码位置:https://github.com/go-gorm/gorm/blob/87decced23be0ce21929fe393fc4fa3a936b1ec8/sche...
Gorm About error is "invalid transaction", when delete transaction
2025-01-15 02:23:10
1747
Your QuestionDuring the first transaction, make a delete query twice and commit once.An error occurs when performing a q...
Gorm Count() erases SELECTs for Joins() statement if executed before a Find()
2025-01-15 02:23:05
1865
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/681DescriptionIf you add a Joins() preload statement to a...
Gorm 怎么能在查询前修改查询的字段
2025-01-15 02:22:50
416
Describe the feature我有个需求,想在sql执行前,对字段进行 过滤、删减之类的操作。但是不知道怎么在查询前修改 查询的字段。 因为我的系统每个用户权限不一样,所以看到的字段不一样。 请问有没有相关示例代码可以参考?Mot...
Gorm [QUESTION] - Looking for some help for many to many in gorm v2
2025-01-15 02:22:48
3845
Your QuestionHi all, I'm finding it difficult to define many to many relationship using Gorm in following casesfeatures(...
Gorm Save Error! UNIQUE constraint failed: user_infos.id
2025-01-15 02:22:45
731
GORM Playground Linkhere is my model i update userinfo at here and i alreay have a row in my databasehowever : gorm us...
Gorm Problem with COPY FROM STDIN functionality after upgrading GORM from v1.9.16 to v1.25.6
2025-01-15 02:22:31
3449
Your QuestionHello, everyone!In our project, we are using the COPY FROM STDIN statement to perform bulk imports in a Pos...
Gorm "On duplicate key update" in recursive query using gorm updates only parent_id field for the child record
2025-01-15 02:22:29
2910
The below is golang struct for the table where settings will be stored recursively.// Settings table in databasetype Set...
Gorm Weird behaviour with after query callback
2025-01-15 02:22:27
6895
Your QuestionI want to track every query to the database (MySQL).This is the init:func InitDatabase() error { err = D...
Gorm Support Sqlite Indexed By
2025-01-15 02:22:24
924
Describe the featureSupport the Sqlite INDEXED BY clause when using the UseIndex hint.https://www.sqlite.org/lang_indexe...
Gorm Save失效
2025-01-15 02:22:21
4123
你可以看到我执行了一次更新操作BelongsTo=7但是接下来发生了我始料未及的问题,更新没有成功以下是我打印的sql,belongs_to=3值被还原了UPDATE `coupon` SET `created_at`='2024-01-0...
上一页
下一页
1
…
931
932
933
934
935
…
2246
.