Thanks to visit codestin.com
Credit goes to github.com

Skip to content

unsupported data error with nested joins/preloads #6956

@N-Schaef

Description

@N-Schaef

GORM Playground Link

go-gorm/playground#715

Description

In our project we have deeply nested data that needs to be joined and some additional values preloaded.

In a previous version of gorm (1.25.5) this was working.
Now we get a unsupported data error stemming from gorm/callbacks/preload.go#L140

The issue seems to be introduced in #6877.
The value of db.Statement.ReflectValue.Kind().String() is ptr.
My best guess is that preloads of sub-structs of optional nested structs/joins are the problem.

If I duplicate the whole case reflect.Struct: case (in gorm/callbacks/preload.go#L133) as an additional case reflect.Pointer: case, our code works again.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions