Gorm How to join nested tables

Your QuestionI have models like this:package modelstype ItemAsset struct { ID int32 `gorm:"primary_key;AUTO_INCR...

Gorm autoIncrementIncrement not work in postgres

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/756DescriptionDB: PostgreSQLtype Book struct { // ...

Gorm ERRO[0000] near "(": syntax error in automigraion for sqlite db.

Your QuestionI have a user model for gorm that creates a query.CREATE TABLE `users` (`id` uuid DEFAULT gen_random_uuid()...

Gorm how to control timeout for every single sql statement,like create,update,query,raw sql

Your Questionhow to control timeout for every single sql statement,like create,update,query,raw sqlThe document you expe...

Gorm Transaction not commit under certain special circumstances.

Your QuestionversionMySQL 8.1.0gorm.io/driver/mysql v1.5.1gorm.io/gorm v1.25.2DescriptionI ran into a really weird probl...

Gorm gorm.DB mocking for Unit Testing

I would like to be able to use github.com/stretchr/testify/mock for unit testing my gorm DB instance. However, gorm.DB ...

Gorm Nil pointer dereference in migrator.ReorderModels

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/647DescriptionI've been trying to work around SQLite's li...

Gorm I want to implement global error handling in Gorm

Your QuestionI want to implement global error handling in Gorm, for example, if a 'too many connections' error occurs du...

Gorm fatal error: concurrent map read and map write [with reproduction]

GORM Playground LinkReproducible, but might need to run 100+ times to get it.Had to disable migrations, siince they seem...

Gorm How to create different table names for one struct?

Hello,I have a user model, I want to split it in 10 tables user_0, user_1,...user_9type User struct { Id uint3...

Gorm Connect Postgresql failed in AWS Lambda

Your QuestionHi there, I have a Golang program that use gorm to connect to Postgresql and run in AWS lambda, sometimes ...

Gorm Is there a way to delete orphan when update my model ?

Your QuestionHello,I looked at the doc and issues on github but couldn't find an answer.I've got a recipe model :type Re...

Gorm How to close connection in V2

When I upgrade to V2, the db.Close method does not exist.defer db.close()So how to Close the connection of database in V...

Gorm mysql JSON_SET cannot be used in many ways

I know there are many disadvantages to using json, but in some cases it can improve development efficiency.I happened to...

Gorm 在clause.select中指定expression, 导致指定的[]column被忽略

开发者你好:我在使用clause.select{}构建一个左连接的查询语句的时候,将clause.from{}作为expression传入select中构建查询条件但在clause/Select.MergeClause(clause *Cl...

Gorm rqlite support

Describe the featureSupport for rqlite databaseMotivationrqlite is a lightweight distriuted SQL database based upon SQLi...

Gorm 终于找到了组织,这数据库不用defer db.Close()?

从v1到v2,看示例和链接数据库里都没有defer db.Close(),新手一枚,感谢大神指点The document you expected this should be explainedExpected answerComment...

Gorm Gorm lack of performance!?

Your QuestionI am using gorm as my database adapter and when running my application, gorm database calls increase linear...

Gorm how about for softDelete add 1/0 turn value

官方soft_delete插件,只提供了1作为删除,但是有些情况,0也是代表删除,或许可以给这个插件添加一个自定义值? The official soft_delete plugin only provides 1 as a delete,...

Gorm 有 uniqueIndex 的情况下,AutoMigrate 再次执行会报错:Can't DROP 'xxx'; check that column/key exists

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/733Descriptiontype User struct { EnglishName string `j...
上一页 下一页
.