Gorm Appending/Replacing Associations Should Not Create Records on the Related Table

Describe the featureI've been trying to implement an M2M relationship on two models for the past two days now and have c...

Gorm too much time cost for a simple sql

Your QuestionA very simple sql cost too many time when limit >= 85. Any idea on why? 10 times longer than when limit ...

Gorm Why does open PrepareStmt perform Prepare in advance

Your Question db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{ PrepareStmt: true, })gorm 开启 PrepareS...

Gorm concurrent update table error

package mainimport ( "fmt" "gorm.io/driver/mysql" "gorm.io/gorm")type Product str...

Gorm 使用 reflect 构建的 model 对象在 Find 中 Preload 失效

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/619Description我对 gorm 做了一层符合我们业务场景的封装,手动使用 relfect 构造了 Fi...

Gorm Not insertng foreign key or polymorphic key when dealing with nested models.

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionComment From: github-actions[bot]The issue ha...

Gorm Gorm generate doesn't escape characters of default value

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/640DescriptionI have the following table:CREATE TABLE IF ...

Gorm Can I use Preload With Scan?

Your QuestionLet's say I have two tables test_user and language, and a many-to-many table test_user_languagetype TestUse...

Gorm I want to specify the table name when specifying the field

Describe the featuregorm:"column:tab.col"I want to specify the table name when specifying the fieldMotivationwhich can s...

Gorm Error on insert or update on table violates foreign key constraint

Your QuestionI have the following set of GORM models, with 2 orders of one-to-many relations:type Order struct { ID ...

Gorm How create mysql8 Multi-Valued Indexes in gorm?

Your QuestionCREATE TABLE customers ( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, modified DATETIME DEFAULT CUR...

Gorm Using query callback after raw exec will use the table name of the previous handle

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1DescriptionWhen I use raw sql to execute, and then use t...

Gorm How to new a new DB object from a DB

How to new a new db object from a db object ?func QueryTest(db *gorm.DB) { var res []User db = db.Table("aaa&...

Gorm unsupported select args

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Descriptionstart := 1 end := 2 var result map[stri...

Gorm Query whether HOOK can cancel the current record

Your QuestionI perform some Redis operations in AfterFind to prevent duplicate recommendations (do not return the curren...

Gorm Query with On Conflict Clause And Function for Upsert flow

Your QuestionHow do I achieve a query like below with this library?INSERT INTO "users" ("user_id", &...

Gorm Unable to automigrate for with foreign keys

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/638DescriptionAutomigrate does not seem to work well with...

Gorm New entries from nowhere?

Go Version: 1.20Gorm Version: gorm.io/gorm v1.25.2Driver: gorm.io/driver/postgres v1.5.2I have the following code. type ...

Gorm Wrong references when embedded struct has the same field

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/637DescriptionWhen embedding structure with embeddedPrefi...

Gorm Postgres: clean or existing database affects whether WHERE clause affects index

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/627DescriptionHello! I'm using gorm in a postgres web app...
上一页 下一页
.