Gorm Is there any way to pass additional data to hooks?

Your QuestionIs there any way to pass additional data to hooks?I need to pass the user ID of the current logged user to ...

Gorm 软删除之后的行还可以被设置值

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/1Description软删除之后的行还可以通过以下的方式设置值 db.Model(b).Update("PId"...

Gorm Many To Many Query (Filter)

I am having an issue querying a many to many relationship...My relationships are as followstype User struct { ID stri...

Gorm AddIndex 方法问题

Gorm V1 提供 AddIndex 和 AddUniqueIndex方法可以手动添加索引。旧项目用此方法:例如现在想升级gorm v2,貌似可以用Migrator.CreateIndex, 但是有几个问题:1.要必须在struct字段添...

Gorm 1.22.4版本按照文档软删除失效,反而是硬删除

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

Gorm How to Preload recursive table?

Your QuestionI have a reply table that looks like this:type Reply struct { ID string `gorm:"colum...

Gorm Proto3使用的麻烦性

Describe the feature问题:是否能够支持一种注入方法,实现自定义类型解析原生数据类型,不通过Scan和Value方式。在proto中,定义一个message只能用一些基本类型,比如 repeated map 等对象,假如我...

Gorm Sqlite内存模式下无数据问题

最近在使用该模块,发现一个问题: 1. 在指定sqlite的指定有效时间后(sqliteDb.SetConnMaxLifetime(1 * time.Minute)),发现到达时间后再次请求数据里的连接是无数据的,这个设计有点不理解,...

Gorm How can I access nested model fields for Preload chaining?

How can I access nested model fields for Preload chaining?The example mentioned on GORM.io works fine but not when using...

Gorm gormV2版本怎么没有beforeFind了呀 看代码和文档只有queryCallback.Register("gorm:after_query",

Describe the feature查询之前,加上钩子 before_queryMotivationbeforeFind before_query这个钩子比较重要,可以在查询前通过钩子查询是不是需要访问缓存Related Issue...

Gorm go get is deprecated, use go install

The documentation still refers to go getgo get is however deprecated. the advice is to use go install Comment From: gith...

Gorm Require a method to return raw sql for pipeline control, not just for logging.

Describe the featureRequire a method to return raw sql for pipeline control, not just for logging.Most case we use ....S...

Gorm 指教下会话模式的用法

https://gorm.io/zh_CN/docs/context.html能说下会话模式的用法吗?以及什么场景下使用会话模式?如果不使用会话模式难道就会引发并发安全问题吗?Comment From: github-actions[bot...

Gorm Require a method to return raw sql for pipeline control, not just for logging.

Most case we use ....Scan(), ....First(), ...Find(), ...Delete(), ...Update, ... Updates ...Create to executed a sql.How...

Gorm batch update not support

I find that gorm has [Upsert / On Conflict] feature, but that means "create NEW and update if exists", it will create ne...

Gorm panic: query after update

Your Questionif I call like this :(update(XXX).First())it will panic:when I debug code:error will return in here:stmt.Sc...

Gorm after create, tx.Statement.SQL.String() got empty

I tried this, but not got the expectation.func (cars *CARS) AfterCreate(tx *gorm.DB) (err error) { fmt.Println("...

Gorm Reduce CGO for better cross-compile experiences

Describe the featureReduce the use of CGO for better cross-compile experiences. For example, to cross compile operation ...

Gorm List 3rd-party pure-Go SQLite driver in GORM docs

Describe the featureI am maintaining a fully-tested pure-Go SQLite driver for GORM (https://github.com/glebarez/sqlite)T...

Gorm NameReplacer: strings.NewReplacer("Model", "") 会panic

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/432Description我想使用 NameReplacer: strings.NewReplacer("Mod...
上一页 下一页
.