Gorm *string and *int cause left join not to return nil

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/781DescriptionI have two model structs. When I combine th...

Gorm Why is there an extra insert query running for updating Many to Many field updates?

Why is there an extra insert query running for updating Many to Many field updates? [check the second last INSERT query]...

Gorm Why update by map do not run Value() (driver.Value, error)

Why update by map do not run Value() (driver.Value, error) function?db.create() will run the function.Comment From: gith...

Gorm invalid value, should be pointer to struct or slice

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/662DescriptionAfter adding BeforeSave hook, updating mode...

Gorm Many2Many with custom join table gets converted to snake_case when with TableName() function

Your QuestionUnable to set custom many2many table, always gets converted to snake caseThe document you expected this sho...

Gorm 如何全局禁用掉关联表数据的默认写和删除操作

Your Question在我目前的项目里,会需要使用 Preload Joins 这样的方法,但是确实不需要写操作的时候也去处理关联数据,所以我期望能全局禁用掉这个默认或者非默认行为,防止团队成员使用导致非预期错误。经过调研,找到了三种方...

Gorm gorm forces it's own primary key when i want to use my own

Example:type Trigger struct { Base}type Base struct { ID string `gorm:"primaryKey;autoIncrement:fal...

Gorm Using only offset instead of limit

Your QuestionWhen I use offset but not limit, the SQL executed by Gorm only includes offset and not limit. Unfortunately...

Gorm Enhance db.Scan with ParamsFilter

Describe the featureIn callbacks.go you can find the processor.Execute implementation. Within it, this code: if stmt.SQ...

Gorm IndexOption的priority字段是小写,包外无法访问

我们现在有自己开发数据库驱动的需求,在实现index时候,发现priority小写,导致联合索引的排序在包外无法实现。index相关的字段,除了priority其他所有字段都为大写,包外可访问,此字段是否改为大写Comment From: ...

Gorm id 字段被强制设置成主键问题

Your Question表中有一个 id 字段,我并不想将它设置为主键,因此,我设置了 primaryKey:false,但是不起作用。type Test struct { ID int64 `gorm:"autoInc...

Gorm parseDDL cannot process fields properly

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/780DescriptionI'm using SQLiteI wasn't using GORM before,...

Gorm Find with interface does not work

Your QuestionWhen using Find with a value which is of type any or interface{}, the slice does not get filled with the re...

Gorm Statement.table has a BUG.

GORM Playground LinkDescriptionStatement.table. If it exists and is an unexpected value, it may cause the query to ...

Gorm [Proposal] Monitor gorm with https://github.com/alibaba/opentelemetry-go-auto-instrumentation

I found that gorm doesn't have the ability to integrate tracing and metrics by default and there doesn't seem to be a be...

Gorm Postgres数据库DSN设置TimeZone可能造成的异常情况

Postgres数据库中DSN设置timezone和TimeZone可能造成的异常情况package mainimport ( "fmt" "gorm.io/driver/postgres&quot...

Gorm RETURNING clause doesn't generate corresponding SQL

Your QuestionAdding clause.Returning{} with the return columns specified has no effect does not add a RETURNING clause t...

Gorm Updates cant auto set updated_at when strcut dont have Updated_at field.

GORM Playground Link[<!--To ensure your issue be handled, the issue MUST include a GORM Playground Pull Request Link ...

Gorm Using a similar model to map but preload is wrong

First, I have the Post model, which has been migrated to the database:type Post struct { ID uuid.UUID ...

Gorm Error: Commands out of sync. Did you run multiple statements at once?

go version: go1.14.1 darwin/amd64Server version: 10.3.17-MariaDB MariaDB Serverpackage mainimport ( "github.com/...
下一页