Can we use tag to specify preload options in Gorm v2

Viewed 98

In Gorm version 1 we could tell Gorm not to preload nested model by default using struct tag:

type NestedModel struct {
}

type Model struct {
    Inner []NestedModel `gorm:"PRELOAD:false"`
}

Is there a way to do that with Gorm version 2? I would like not to hard-code the specific name of the field in database access service.

0 Answers
Related