Gorm one to one or one to many Relate

one to one or one to manyeg Official website Code:`// User 有一张 CreditCard,UserID 是外键type User struct { gorm.Model Cred...

Gorm I Can not work rollbackto.

Your QuestionHi everyone,I use testify and gorm in my project. I've created a testsuite which can be seen below. I've de...

Gorm How to get *sql.Tx from the existing gorm transaction?

Your QuestionI know that gorm supports standard sql package conversion in db level using db.DB() but I couldn't find how...

Gorm Can't do simple update when there is a previous update clause

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/552DescriptionI'm having an issue with a custom data type...

Gorm i want ask can clear where condition. this like session NewDb

Your QuestionI have a piece of code, looking that this likefieldDb := db.Model(&MyModel{}).Select("first_field,...

Gorm Regression of Scan when loading pointer object in a struct

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/504DescriptionThere seems to have been a regression from ...

Gorm Gorm is iterating incorrectly when declaring a pointer to Embedded structs

type Enbedded1 struct { value string}type Struct1 struct { *Embedded1}When I query over Struct1 the same (last) value ...

Gorm 使用多对多自定义连接表,无法添加外键

Comment From: github-actions[bot]The issue has been automatically marked as stale as it missing playground pull request ...

Gorm HasMany: ForeignKey as String

Your QuestionIs it possible to use a String as a specific ForeignKey ? Using PostgreSQL AdapterGolang 1.19.1 linuxgorm.i...

Gorm Memory leakage occurs during table creation and deletion.

version:gorm v1.22.3Test Scenario:create and drop table between sleep 1suse the code droptable:// DropTable drop table f...

Gorm Configure a timeout while making a connection to the Database

Your QuestionHow do we configure a connection timeout while connecting to the database? Context:If the database is not r...

Gorm Prepared Statement with Multiple Parameters Gets Corrupted

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/550DescriptionThis page:https://gorm.io/docs/sql_builder....

Gorm DB.Count() return error value

I queried how many rows in tables use DB.Count(), it return 0, but there are 1 row matched in table. I trace this proble...

Gorm hasMany and hasOne cause "define a valid foreign key" error if field names are identical

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionThe previous changes of @yushulgin haven't fi...

Gorm db.Callback().Raw().Before doesn't work

Hello, when I use the Gorm to before, after method if err := idb.Callback().Create().Before("gorm:create").Regist...

Gorm Gorm docs search cannot search through code snippets

Gorm docs search cannot search through code snippets.E.g search for db.exec no luck but it's present on this page https...

Gorm I can't use SET in db.Raw() or db.Exec()

Your QuestionI have a query like this.SELECT GROUP_CONCAT(distinct concat('max(CASE WHEN attribute_name = "' , attr...

Gorm updates() also updates non-nil field of a struct?

Your QuestionIn document of "Updates multiple columns":When update with struct, GORM will only update non-zero fields, a...

Gorm How to use autoIncrement and autoIncrementIncrement?

Your QuestionautoIncrement 和 autoIncrementIncrement 好像没有效果.autoIncrement and autoIncrementIncrement seems has no effect....

Gorm 同样一份SQL,代码生成出来会报错,但是手动复制生成的SQL用Raw执行就正常

生成代码如下:错误信息: Error 1055: Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'gtest...
上一页 下一页
.