Gorm Support UNION and UNION ALL

Describe the featureI am using gorm for mysql and I need to generate UNION and UNION ALL queries. MotivationQuery optimi...

Gorm Panic on db.CreateTable(Something{}) when using CreatedAt and UpdatedAt fields.

The code: https://gist.github.com/ainar-g/7323528If I use &User{} instead of User{}, or remove CreatedAt and Updated...

Gorm gorm [][]uint field

gorm.io/gorm v1.24.2PGSQL:v14.2aaa [][]uint `gorm:"type:integer[][]"`gorm SQL:UPDATE "table" SET "aaa"=((3,8))"error:Th...

Gorm Replacing Associations Should Not Create Records on the Related Table

type User struct { gorm.Model Account string json:"account" gorm:"column:account;type:varchar(30);not null;commen...

Gorm Batch insert fails to return correct auto-incremented primary key when auto_increment is set to 2 in mysql

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/254/filesDescriptionMy mysql is configured with auto_incr...

Gorm An embedded struct cannot use db.Model to specify a model class to insert data

Your QuestionAn embedded structure cannot use db.Model to specify a model class to insert dataThe document you expected ...

Gorm 日志中的sql和实际执行的不一致

GORM Playground Linkhttps://github.com/go-gorm/gorm/tree/v1.25.3Description表结构CREATE TABLE `user1` ( `uid` varchar(64) ...

Gorm generated always as run SQL syntax Error

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1// main.gopackage mainimport ( "database/sql&quo...

Gorm What is the right way to use procedures in GORM?

Your QuestionI run a procedure with GORM but the data is missing. There are shifts in data sets. I will give an example ...

Gorm How to use unique constraint effectively along with DeletedAt

Using a unique constraint on a column in a table along with DeletedAtI have a scenario where I would like to add a uniqu...

Gorm Is it possible to populate Virtual field of Nested model in gorm

Your QuestionIs it possible to populate Virtual field of Nested model in gorm for total_unique_visit and total_visit whe...

Gorm Join with table alias

Your QuestionRight now when use gorm to join table it should be looks like this:db.Model(&Users{}). Joins("u...

Gorm Can native tx and gorm tx integrate with each other?

Your QuestionI have a component using native sql transaction(*sql.DB.BeginTx). Is it possible to integrate with gorm's T...

Gorm AutoMigrate can break clickhouse data if you change a column type

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/639DescriptionWhen changing the column type AutoMigrate p...

Gorm Postgres: AutoMigrate not stable for type:varchar;default:''

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/644DescriptionEvery time we run AutoMigrage we get the sa...

Gorm 默认值不更新

db.Model(&user).Select("Name", "Age").Updates(User{Name: "new_name"})在tag里给Age设置了默认值1,...

Gorm invalid field found for struct

type JWTLoginRecord struct { ID uint gorm:"primaryKey" json:"id;->" UserID string gorm:"not n...

Gorm i got same query as one time

i've a problem with begin transactioni'm logging out at apm it's show same query at two time then database going deadloc...

Gorm Gorm string type turned into an integer when using SQLITE3

GORM Playground LinkGORM PLAYGROUND LINKGO PLAYGROUND LINK⚠️ Go playground has CGO Disabled, hence you cannot run code...

Gorm gorm.io/gorm v1.25.4 在Go1.17环境中不可用

package mainimport ( gorm.io/driver/mysql v1.5.1 gorm.io/gorm v1.25.4) dsn := "root:root@tcp(127.0.0.1:330...
上一页 下一页
.