Gorm 一对多添加关联时,many表有unique。引发重复时不报错

go version go1.17.6 windows/amd64gorm.io/driver/mysql v1.3.2 gorm.io/gorm v1.23.2 表结构:type Users struct { Id ...

Gorm Select类型语句添加Hint无效

1、想对一个select语句的开头增加一个hint注释,下面这种写法发现hint没有加上package mainimport ( "fmt" "gorm.io/driver/mysql" ...

Gorm 版本号作为查询条件

表中有一列放的是版本号,格式是三段式,例如:1.2.21现在想要根据这一列来进行查询,例如:查询版本号大于1.0.5的所有记录,数据库是MySQL8.0+,请问使用gorm应该如何实现,谢谢Comment From: github-acti...

Gorm Is it possible to DryRun without calling BindVarTo?

Your QuestionIs there a way to run a query in dry run mode, and NOT bind the vars?I have a section of code where I use D...

Gorm Circular reference in model causes app freeze

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/420DescriptionHey there! I've just started using Gorm and...

Gorm panic when preload substruct of nested struct

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/406DescriptionThere are unexpected scenario when I try to...

Gorm How to use preload in Raw SQL ?

Your QuestionIs there any document or example?Comment From: magicLianinnerQuery := db.Raw("? UNION ?", db.T...

Gorm 最新版 1.23.1版 preload 不工作。

Description这两天刚好用到gorm. 可以db.model(&xxx). preload ("***"), 都不到结果,debug 发现preload根本没有进行。换上旧的版本(前年的,不知道什么版本号)工作正常。希望开发...

Gorm fatal error: concurrent map writes

Your QuestionEventually I am having the following error, but I have not been able to reproduce it in a case, what am I d...

Gorm Available struct tags for a Model

Your QuestionWhat are the available struct tags for the model? I can't find it anywhere in the documentation.The documen...

Gorm (MySql)OnConflict for hasOne/hasMany assotiations - specify all (non keys) fields updates for all tables

Your Questionlet's suppose the user table has addresses discounts, whatever - any kinds of hasOne and hasMany relations...

Gorm Queries with Preload return random results from database even if the query is empty

Your QuestionHello ! I have been experimenting with your library for quite a while now, but it seems that I do not actua...

Gorm 是否可以在 errors.go 里增加一个变量表示 Duplicate Entry 错误?

在插入新数据时如果字段是 UNIQUE INDEX 并且已有同样的值,则会报 Duplicate Entry (mysql)错误。是否可以在 errors.go 文件里加一个变量用于表示这个错误?文档里有 Upsert, OnConflic...

Gorm Support a with clause (CTE)

Describe the featureImplement with.go to support a With clause (CTE).I have a fork repository that implements this API a...

Gorm could not import C (cgo preprocessing failed) (compile)

Your QuestionHi what´s wrong with it?The document you expected this should be explainedExpected answer

Gorm Whether the gorm plugin for Go2sky-plugins supports Postgres?

Your QuestionWhether the gorm plugin for Go2sky-plugins supports Postgres?https://github.com/SkyAPM/go2sky-plugins/blob/...

Gorm Conditionally add index using gorm tags

Hi, i want to add unique index on two fields but only if one of them is available.for example:for a model with email and...

Gorm Preload and join with nested

Your QuestionI have this association[A] 1-1 [B] 1-* [C]I want all A with its B and every C for each B and tried with the...

Gorm gorm 支持乐观锁 Version 吗?

Comment From: longbozhan应该不支持,看看能否把这个特性加上去 @jinzhuComment From: chenyu1990Updates(map[string]interface{}{ "total...

Gorm Support associations for Scan

Hey,is it possible to scan associations, because I tried but it didn't work so far:var events []Eventself.DAO.DB.Raw(&qu...
上一页 下一页
.