Gorm 时间格式化对CreatedAt与UpdatedAt不生效

Your Question请教一下为什么时间格式化对CreatedAt与UpdatedAt不生效,对别的字段生效,例如go版本:1.18.1依赖版本gorm.io/driver/postgres v1.3.7gorm.io/gorm v1....

Gorm Get inserted data in Create().After hook, especially PrimaryKayValue

Get inserted data in Create().After hook, especially PrimaryKayValueDescriptionIt would easliy implement in gormV1, d...

Gorm Is there a way to replace associations without the creation portion of upsert?

Is there a way to replace associations without making a call to insert the associated entities?The document you expected...

Gorm many2many has a question:Error 1075: Incorrect table definition; there can be only one auto column and it must be defined as a key

Description多对多关联,表迁移的时候,如果中间表对应的关联表不是主键id的话,创建会报错,报错内容为:Error 1075: Incorrect table definition; there can be only one au...

Gorm 基于grom官方应该开发一个缓存功能 可以基于redis来进行配置

Describe the feature在一些特殊的查询下 可以接受一段时间内,直接获取缓存数据(redis),这个时候可以来直接调用官方提供的方法来实现,虽然开发者也可以去实现,但是我感觉写在官方库内会更好,场景1比如需要统计一些没有实时...

Gorm Split pre-built query to separate conditions

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/421/filesDescriptionHello there! We started migration fro...

Gorm v1.23.x third automigrate causes error in postgres

With the latest gorm and postgres the third automigration is causing an error in Postgres.I've found this issue fixed:ht...

Gorm ERROR: operator does not exist: date >= integer (SQLSTATE 42883)

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/463DescriptionOn PostgreSQL 14.2, was comparing date in a...

Gorm Support GENERATED (aka "virtual") columns in GORM models

Describe the featureSupport for "generated" (aka virtual) columns as an independent struct tag option, something along t...

Gorm 关于结构体零值不更新问题

现在对于结构体零值不更新的问题,官方好像给的说法只能用map,但是个人觉得map代码的可读性没有用结构体看起来工整,还需要自己定义对应的字段名字符串,这个有比较合适的解决方案吗。个人觉得这里不应该通过零值去判断是否,考不考虑引入指针,通过指...

Gorm Is it possible to specify charset and collation for table creation?

Hi,I'm wondering if it's possible to specify charset and collation for table creation?I searched existing issues and fou...

Gorm Scan进行扫描为null数据结果非预期

Your Question使用Scan 进行扫描后:行数据内email 为null的情况下,将会被上一个email有值的数据覆盖The document you expected this should be explained数据表 数据...

Gorm Google Spanner Driver

We would really love to see a google spanner driver for gorm ❤️ Comment From: github-actions[bot]The issue has been auto...

Gorm gorm v1.23.6 use Find scanning data to struct slice problem

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/486Description使用 Find 扫描数据到结构体切片,如果结构体字段类型为 string,数据库字段值...

Gorm how to add extra field on many2many first create

Your issue may already be reported! Please search on the issue track before creating one.What version of Go are you usin...

Gorm How do I add a field to a many2many table and use it?

type Student struct {ID intName stringCourses []Course `gorm:"many2many:student_courses;"`}type Course struct ...

Gorm Read Only Fields

How to create read only FieldsThe document you expected this should be explainedExpected answertype Product struct { ...

Gorm When column is NULL it takes the value from previous record

GORM Playground Linkhttps://github.com/khanakia/gorm_playground_scan_nullDescriptionRun code: GORM_DIALECT=postgres go t...

Gorm 'AfterDelete' Hook does not triggered in Batch Delete

Your QuestionIt seems AfterDelete hook does not triggered when using Batch Delete.Example: tx.Model(&User{}).Where(c...

Gorm Howto Create virtual Fields ?

Howto Create virtual Fields ?How do I create a virtual field in the model, to bring a select like this:SELECT id,name,pr...
上一页 下一页
.