Your Question
i'm using the v1 of the library , and i wonder if i'm using eager loading through a preload function like below, will it be faster & efficient if i return the relation with first function?
From this:
tx := mc.mysqlDB.Select("personid").Preload("Person", func(db gorm.DB) gorm.DB { return db.Select("details") }).First(&book, "id = ?", id)
To this:
tx := mc.mysqlDB.Select("personid").Preload("Person", func(db gorm.DB) gorm.DB { return db.Select("details").First(&Person{}) }).First(&book, "id = ?", id)
The document you expected this should be explained
Expected answer
is the first function a necessary call or is it useless in my case?