Gorm Incorrect ON CONFLICT when using composite primary key

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/652DescriptionExplain your user case and expected results...

Gorm FirstOrCreate Behaviour

Your QuestionHi,I am using the FirstOrCreate function.Suppose I have these trow structs and the corresponding tables:typ...

Gorm Scope not working in combination with callback

Your QuestionI added a custom callback and wanted to use a scope in. Bute the scope will not be called as expected. See ...

Gorm Need a function that gives us the TableName for any given struct

Describe the featureI want to get the name of the table for an arbitrary struct (that may or may not have a custom namin...

Gorm memory leak

step1:x1 = dbCC.WithContext(context.Background()).Model(&mode).Limit(nPageSize).Offset(Offset*nPageSize).Order(&quot...

Gorm When using GORM to customize a parent model and implement logical deletion, the table is incorrect.

mybasemodel:type BaseModel struct { Id uint gorm:"primarykey" CreatedAt time.Time gorm:"column:add_ti...

Gorm DB tables and fields static typing

It is a bad practice to use pass DB field names as plain text to ORM methods.It is too easy to make a typo or forget a f...

Gorm Unexpected query result by using struct{} with &

// controllerif total, err := (models.UserAccountMessageRead{}).GetCountByIds(&models.UserAccountMessageRead{ Ope...

Gorm Automigrate cannot work properly when unique constraint changed.

GORM Playground LinkNo Link.DescriptionI basically use a migrate function to update my database(mysql) schema. But when ...

Gorm Can't insert array []string into PostgresDB with GORM

Why is GORM not built-in to insert an array of strings into PostgresDB? Comment From: github-actions[bot]The issue has b...

Gorm Many2Many Multi-table query using Join Table error: Unknown column

I have two tables doing many2many, but when I try to join the query, he always reports that the column cannot be foundty...

Gorm Gorm MSSQL conditional unique index not working

DescriptionAs per the documentation on https://gorm.io/docs/indexes.html#Index-Tag gorm supports conditional indexing us...

Gorm Gorm 关于 updates的问题

代码如下。type xxxx struct { ID int gorm:"column:id" Email string gorm:"column:email" Mobile ...

Gorm CreateInBatches is not running inside Transactions

I would expect code like thisreturn d.table().Clauses(clause.OnConflict{DoNothing: true}).CreateInBatches(records, 2000)...

Gorm Preload with many entries results in empty return

Your QuestionMy question is: Why does Preload behave differently, with a larger number of entries?The line in question l...

Gorm Custom error message on validation

Custom error message on validationHi i would like to know if there is a workaround for custom error message so front end...

Gorm goland 控制台输出的sql日志问题

goland 控制台输出的sql日志无法直接点击进行跳转原打印样式(蓝色链接点击可跳转到sql源代码处):现打印样式(绿色链接不可点击):Comment From: github-actions[bot]The issue has been...

Gorm Returned error is not gorm.ErrDuplicatedKey when duplicate entry is being created

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/649DescriptionWhile creating a duplicate entry the error ...

Gorm Postgres: AutoMigrate re-migrates everytime for some types

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/646DescriptionEvery time we run AutoMigrage we get re-mig...

Gorm distinct did not take effect when shared with count

Your Questiondistinct did not take effect when shared with count, mysqldb.db.Model(&User{}).Distinct("name&quot...
上一页 下一页
.