Gorm 一对多的自引用查询层数问题

Your Question数据库数据:MariaDB [svcuser]> select * from article_replies;+----+-------------------------+-----------------...

Gorm 国内文档站太慢了

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

Gorm How do I use smart select fields and preload function together?

Your QuestionI want to select specific fields of User, so I defined a smaller struct called APIUser which can select spe...

Gorm What is the most optimal and fast way of setting up data sets for unit tests

Your QuestionI'm looking for a way of populating the database per-test. The most important part is that it needs to be a...

Gorm how to dump a sql when using CreateInBatches

Your Questionsql = tx.ToSQL(func(tx *gorm.DB) *gorm.DB { return tx.Model(&entity.InboundApplicationSkuExtend{...

Gorm How to query based on associations?

Your QuestionNot sure if I'm missing something here.We spend time defining associations (many-to-many, etc.). I'm assumi...

Gorm Running migrator on multiple DB in parallel throws error

GORM Playground LinkDescriptionWe have multiple DB's in a MySQL instance, each of these DB's have multiple tables. When ...

Gorm How to use Xid as primary key ?

Your QuestionHi !I defined a base model to reuse for all tables. The id was generated automatically using https://github...

Gorm How to scan ignored field gorm:"-" ?

I have struct like thistype Menu struct { Name string `json:"name" gorm:"type:varchar(150);&...

Gorm 没有外键的表怎样实现自关联

我有一个表如下 ,没有外键。希望能够进行自关联查询当前节点和父节点的数据,结构定义如下type ObjectX struct { Id int64 `gorm:"Id"` ...

Gorm 如何构建一个select子查询中函数带复杂条件的SQL

想要构建一个select子查询中函数带复杂条件SQL,例如clickhouse的countIf举例一个目标SQL:select countIf ( ( columnA in (1, 2) ...

Gorm Unable to preload many2many entities when id=0

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/623 (tested with GORM_DIALECT=postgres)DescriptionExplain...

Gorm Unnecessary SELECT query when preloading a has-many association

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/626DescriptionConsider these models:type Skill struct { ...

Gorm Update Query inconsistency

I am having an issue with my structs not being able to update values for foreign keys with GORM. When I use the Save met...

Gorm Always Omit fields

First, thanks for this piece of work. It helps a lot in my project!Your QuestionI have 2 tables with many to many relati...

Gorm Has many relation using two columns for foreign key

Your QuestionI'm trying to link two tables together with a one to many relationship and I do not see documentation for l...

Gorm Tuple Query 可以支持 where (a, b) < (v1, v2) 这种查询吗?

Your Question可以支持下面这种查询吗?SELECT * FROM table WHERE (a, b) &lt; (10, 2) ORDER BY a DESC, b DESC;The document you expected...

Gorm Default value for ID column can't be disabled

GORM Playground Linkhttps://github.com/go-gorm/playground/pull/625DescriptionThe default:(-) tag doesn't work for ID. Th...

Gorm 每调用一次api, db 的查询条件会累加,是不是有问题啊?

调用同一个api3次, 都是查询同一个数据第一次:[101.228ms] [rows:1] SELECT * FROM oneos_project WHERE oneos_project.project_id = '148124708640...

Gorm Duplicated key test introduced in #6389 fails if key already exists

DescriptionThe test introduced in #6389 fails if the key already exists.For instance, this fails for SQLite on a second ...
上一页 下一页
.