Gorm Is it possible to dynamically group conditions?

Your QuestionIs it possible to dynamically group conditions?The Grouped Conditions in the documentation are hard coded, ...

Gorm 创建记录时零值布尔字段无法通过select()指定

db.Select("*").Create()布尔零值即使使用了Select指定,MySQL最终的记录值还是Model中gorm tag default:null指定的null。Comment From: github-actions[bo...

Gorm 不使用gorm.Model 里面的ID命名,一对多,一对一的struct 维护起来及其困难,没有头绪

类似这里的问题:https://stackoverflow.com/questions/69990097/gorm-2-golang-auto-migrate-table-with-foreign-key使用默认的ID,把很多细节都隐藏起来...

Gorm Enum tag does not work with postgresql when Automigrate.

This tag does not work with postgresql when Automigrate.sql:"type:enum('owner', 'write', 'read');"but mysql worked.postg...

Gorm Where(whereStr, args...)中的in条件和Group同时使用时出现语法错误

version: 1.23.8error: sql: converting argument $5 type: unsupported type []int64, a slice of int64Comment From: github-a...

Gorm clause.Set MergeClause is not merged correctly

When adding a clause.Set to the db.Statement don't merge the original clause expression, but overwrites it.Currently cod...

Gorm Models with composite keys cannot be successfully removed using Delete(...)

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/405DescriptionI think, Gorm should generate valid sql and...

Gorm How to create foreign key constrains after creating tables?

Your QuestionThe solution I found for https://github.com/go-gorm/gorm/issues/5695 seems to be:type A struct { ID ...

Gorm How to combine HasMany and BelongsTo to the same table?

Your QuestionI create BelongsTo relationship:type A struct { ID uint MyFavoriteBID uint ...

Gorm sqlserver query with where condition has error

db driver use gorm.io/driver/sqlserversqlserver version: 2019 devorm := db.Table("t_test").Where("id = ?&...

Gorm gorm.Expr() does not support subQuery

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/230DescriptionWhen I use subQuery in Expr(), it throws me...

Gorm Migrator fails with SQLSTATE 42704

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/433DescriptionModel:type Group struct { ID string `...

Gorm What is the best way for type ColumnType to return extra info, ex displayType.

Your QuestionHi, I am new to golang, I have one question about ColumnType.In my example, I have one column named "positi...

Gorm How to execute COUNT (*) OVER() AS some_column_name using GORM

Your QuestionHow to execute COUNT (*) OVER() AS some_column_name using GORMThe document you expected this should be expl...

Gorm Is there any Preload equivalent, but to use combined to gorm.Create?

Your QuestionIs there any Preload equivalent, but to use combined to gorm.Create? For example, image these structures:ty...

Gorm 请问设置了关联后,数据库可以不添加外键的吗

代码package modelimport "gorm.io/gorm"type Note struct { gorm.Model UserId int GroupId int Questi...

Gorm Driver for pure Go sqlite implimentation

Describe the featureDriver for https://pkg.go.dev/modernc.org/sqliteMotivationSo that we can use a sqlite DB without nee...

Gorm How to make "created_at,updated_at" field work as expected(Timestamp Tracking) when set default value "1970-01-01 00:00:00"?

Your QuestionIn Product environment, filed set default null is not allowed. Thus we usually set create/update time field...

Gorm Problem with MSSQL: "Invalid usage of the option NEXT in the FETCH statement. "

Hello, I'm trying to create a "Create or Update" approach on MSSQL using Gorm. Since GORM has firstOrCreate() and Assign...
上一页 下一页
.