Nineya
Home
Blog
软著申请
Gorm After mysql is updated, return the updated value, using variables
2025-01-14 08:35:33
1188
Execute native sql, define variables, and return the updated valuenative sqlUPDATE admin_account SET created_at = @creat...
Gorm Syntax error while formating slice value
2025-01-14 08:35:30
2361
go.mod:module gorm-examplego 1.18require ( gorm.io/driver/postgres v1.4.6 gorm.io/gorm v1.24.3)require ( github...
Gorm What is the correct way to lock when using FirstOrCreate?
2025-01-14 08:35:28
1930
What is the correct way to lock when using FirstOrCreate?Hi, I'm using FirstOrCreate in order to perform a pretty standa...
Gorm How to preload multiple tables with one id field?
2025-01-14 08:35:25
634
Your QuestionExample: type T1 struct { AnyID uint // it's T2.id if AnyType=1, otherwise it's T3.id AnyType int T2 ...
Gorm BeforeSave hook prevents legitimate updates
2025-01-14 08:35:22
1762
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/521DescriptionThis is a bit of an edge case I found: Befo...
Gorm Drop unique constraint on index
2025-01-14 08:35:20
737
Your QuestionI have the following model: type Test struct { ID int64 `gorm:"primaryKey"` Name string `g...
Gorm BeforeUpdate不生效?
2025-01-14 08:35:17
822
Your Questiontype User struct { Name string}func (u *User) BeforeUpdate(*gorm.DB) error { u.Name = "Faker&quo...
Gorm Report if AutoMigrate() will change the schema.
2025-01-14 08:35:15
3213
Describe the featureReport if AutoMigrate() will change the schema.One possible way:With Session.DryRun = true, AutoMigr...
Gorm many2many 指定大写的表名无效,关联查询时候自动转换为带下划线的表名
2025-01-14 08:35:12
1321
而我实际生成环境的数据库已有的表名是residentOrgsComment From: github-actions[bot]The issue has been automatically marked as stale as it mi...
Gorm How to create a reference without creation of association itself in many-to-many use case
2025-01-14 08:35:05
7755
QuestionIs it possible to create a reference without creation of association itself in many-to-many use case?E.g. I have...
Gorm .Pluck() to log correct number of rows returned
2025-01-14 08:35:02
690
Describe the feature.Pluck() should return correct number of rows returned from DBMotivationIn the debug logs of query ...
Gorm Is this a effective way of executing UPDATES with struct?
2025-01-14 08:35:00
3553
Is this a effective way of executing UPDATE?The document you expected this should be explainedExpected answerHere is the...
Gorm How increment column version on each modify model via hook?
2025-01-14 08:34:57
3867
Hi, I have model and BeforeSave hookfunc (m *User) BeforeUpdate(tx *gorm.DB) (err error) { tx = tx.UpdateColumn("...
Gorm .Pluck() is not logging correct number of rows returned
2025-01-14 08:34:54
1021
DescriptionIn the debug logs of query execution, .Pluck() is always printing [0 rows affected or returned ] even though ...
Gorm Custom schema and too long table name generate invalid constraint
2025-01-14 08:34:52
4446
GORM Playground Linkhttps://github.com/go-gorm/playground/pull/428DescriptionIt appears that a table name that includes ...
Gorm Modification of string fields to LONGTEXT without a length..
2025-01-14 08:34:49
3324
GORM Playground Linkhttps://go.dev/play/p/qkJo3hCfVBNThe link above is created to appease the bot.https://github.com/go-...
Gorm Does gorm support pgxpool?
2025-01-14 08:34:46
825
The default driver used by gorm for Postgres is pgx as per this doc: https://gorm.io/docs/connecting_to_the_database.htm...
Gorm i need insert 5 rows, with colum ID = 0, but gorm neglect 0 values, how to fix this?
2025-01-14 08:34:44
2837
i need insert 5 rows, with colum ID = 0, but gorm neglect 0 values, how to fix this?The document you expected this shoul...
Gorm Question: Postgres schema name
2025-01-14 08:34:41
2941
File a_day_learn.gopackage mainimport ( "fmt" "gorm.io/driver/postgres" "gorm.io/gorm&...
Gorm How can I use an aggregate function inside SELECT statement ?
2025-01-14 08:34:31
1769
Your QuestionHello,Imagine that I have 2 tables Clients and Tickets.So I would like to get a list of clients with a list...
上一页
下一页
1
…
962
963
964
965
966
…
2246
.