Gorm Gorm query select columns arguments

Your QuestionHow to mention arguments when select columns has variables ?SELECT SUM(CASE WHEN bin_start > ? THEN coun...

Gorm about sql parsed

Your QuestionSQL parsed by Gorm : SELECT * FROM `admin` ORDER BY `admin`.`id` LIMIT 1;Carrying backquotes in SQL.The doc...

Gorm 反引号问题

SELECT * FROM admin ORDER BY admin.id LIMIT 1 gorm解析的是这样,有配置去掉 ` 符号吗 我想要 SELECT * FROM admin ORDER BY admin.id LIMIT 1 ...

Gorm How do I get Preload with Select to work?

My two types are below. I would like to return the user plus its known last latitude and longitude and nothing else. How...

Gorm When reusing where condition, previous where clauses are appended to the current query

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/401DescriptionThis causes the query to become incorrectFo...

Gorm update associations

Your Questionfrom the explanation in the official document for updating associated objects, we should use replace but th...

Gorm Adding retries for an error for all DB calls

In application, observing intermittent failures for "hostname resolving error" (Works most of the time, but seeing inter...

Gorm Association doesn't replace the entities with new ones and throw an error.

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/548DescriptionI have two tables Item and ItemContent:type...

Gorm 数据驱动是mysql,Limit和Offset使用 进行分页查询,返回的条数不对,把所有的数据都返回了

DB.Limit(pageSize).Offset((pageIndex - 1) * pageSize).Raw(sql).Scan(out)Comment From: github-actions[bot]The issue has b...

Gorm Pluck Scan called without calling Next

var username string db.Model(&model.User{}). Where("id = @id", sql.Named("id", 100...

Gorm Column name isn't trimmed

That's it. Gave me a bit of a rage tbh, but was a small issue nonetheless. It's probably written in the docs, or not in ...

Gorm When creating some data with associations, the foreign key of the associated struct sometimes would be zero

type Parent struct { ID int64, AppId int, Sons []Son gorm:"foreighKey:app_id,parent_id"}type Son struct { Par...

Gorm db.Create() with model table inside schema

Your QuestionHi, I face a problem. I have model employee with schema dbo_hcis_new. the insert statement is correct. but ...

Gorm Updating value when doing an bulk Upsert

Your Questionthis is related to the https://github.com/go-gorm/gorm/issues/3044 the bulk upsert does update the records ...

Gorm embedded should be nil if not exists

Your Questionrefer to the pr #6219 the test from tests/embedded_struct_test.go works fine.but after i added one field wi...

Gorm How to use gorm.Open with TranslateError: true along dockertest?

How should I open a gorm connection alongside a dockertest pool, while keeping TranslateError: true?I'm trying to implem...

Gorm 打印的sql 里,值被问号代替了,请问怎么配置能显示完整的sql

Comment From: lionwgorm版本号1.25.1代码如下package mainimport ( "gorm.io/driver/mysql" "gorm.io/gorm"...

Gorm It's hard to understand CRUD API with ambiguous semantics.

Your QuestionI just want query a row by id.type AccountLocal struct { ID string `gorm:"primarykey;size...

Gorm Save does not save nested field as I expected

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/580DescriptionI test the following on Postgres.First I cr...

Gorm gorm 关联模型是否支持使用相同的主键进行绑定

Your Question我在文档里看到的一对一模型是需要另外使用一个Id字段与需要关联的记录进行绑定, 在我看来既然是 1对1 关系, 直接使用两个相同的主键来绑定会不会好一点. 使用主键在MySQL也可以减少一次回表操作.目前我的评论表...
上一页 下一页
.