Gorm 期望使用Updates函数更新name字段为空,不会触发sql变更

使用v1.25.9版本,更新db字段失败type Animals struct { Name string `gorm:"column:name"` Age int `gorm:&q...

Gorm what is the diff of gorm tag - and -:all

what is the diff of gorm tag - and -:allhttps://gorm.io/docs/models.html#Fields-Tagsthe above doc explains the - gorm ta...

Gorm Scan row into multiple structs

How to scan a row into multiple structsThe document you expected this should be explainedThis code used to work with 1.2...

Gorm gorm(v1.23.2版本) in查询性能慢的问题

gorm 的版本为 gorm.io/gorm v1.23.2使用gorm去查询数据的时候速度很慢,in查询,in中的数量1500,不同的代码方式差异很大,用参数化查询(?占位)和raw直接拼接的方式性能差异巨大,参数化查询的性能很差,请问这...

Gorm Generic function to upsert objects?

Your QuestionI'm trying to write a generic function to bulk upsert objects in MSSQL and I wanted to check if this looks ...

Gorm ERROR: missing FROM-clause entry for table (SQLSTATE 42P01)

Your QuestionI want to update data with a has-many relationship, but I receive an error ERROR: missing FROM-clause entry...

Gorm GORM can't convert a model to VALUES sql when calling db.Create from a nested gin handler

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/612DescriptionCalling DB.Create(&model) in a nested g...

Gorm SQL statement should be stable

We use below way to generate SQL from GORM:https://stackoverflow.com/questions/66238657/how-can-i-generate-sql-code-from...

Gorm Could you explain to me why you don't report an error when the specified serializer is not found?

Your QuestionI don't think this is a good behaviour:func main(){ var open = gorm.Open("to a PostgreSQL") ...

Gorm 自定义类型使用JSON提示错误:unsupported data type: &[]

Your Question自定义数据类型,在查询的时候提示:[error] unsupported data type: &[],结果是正常的,但是会出现此错误提示。Modeltype PutUser struct { //....

Gorm Omitting a column from the result

Your QuestionI don't want to use "-" to hide a column, because I need to show it almost everywhere. So, how can I exclud...

Gorm Updates 使用 struct 作为参数无法触发 BeforeUpdate 钩子

Your Question现有结构体:type BaseModel struct { ID uint64 `gorm:"column:id;primaryKey;autoIncrement:true;c...

Gorm Serialization error on update

Update with serializer:unixtime does not insert timestamps properlyDescriptionHere's my code, the database mysql:8.0.0 f...

Gorm sqlite3 'row value misused' error when preloading a model with composite primary keys and foreign key relations

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/168DescriptionThere is an issue when loading a model with...

Gorm gorm v2.0 unit testing with sqlmock does not work with Postgres uint

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/738DescriptionI was reading up the now closed issue for a...

Gorm passing struct address through empty interface cannot be success of Save() & Create() & Delete()

Your QuestionHello, I want to make a wrapper function for gorm Save/Create/Delete that uses an empty interface.However, ...

Gorm Panic on Bulk Upsert with Pointer Fields in Slice of Interfaces

Your QuestionI'm trying to pass an slice of interface to the Create method but it returns an error:"unsupported dat...

Gorm Breaking change : define a valid foreign key for relations or implement the Valuer/Scanner interface

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/694DescriptionI am getting the following error Define a v...

Gorm json query with boolean argument fails

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/729DescriptionWhen querying a property inside a json fiel...

Gorm 请教一个用法

DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty"`这样配置,omitempty是不生效的,每次查询,json都会多带一个delete_at: null请教,这个有...
上一页 下一页
.