You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Do not use Preload(clause.Associations) as it will load all associations including those which don't work (e.g. Policy.Rules), leading to a double query
787
+
// Also GroupPeers are not preloaded but loaded separately below
786
788
result:=s.db.Model(&account).
787
-
Omit("GroupsG").
788
-
Preload("UsersG.PATsG"). // have to be specifies as this is nester reference
789
-
Preload(clause.Associations).
789
+
Preload("Policies").
790
+
Preload("SetupKeysG").
791
+
Preload("PeersG").
792
+
Preload("UsersG.PATsG").
793
+
Preload("GroupsG").
794
+
Preload("RoutesG").
795
+
Preload("NameServerGroupsG").
796
+
Preload("PostureChecks").
797
+
Preload("Networks").
798
+
Preload("NetworkRouters").
799
+
Preload("NetworkResources").
800
+
Preload("Onboarding").
790
801
Take(&account, idQueryCondition, accountID)
802
+
791
803
ifresult.Error!=nil {
792
804
log.WithContext(ctx).Errorf("error when getting account %s from the store: %s", accountID, result.Error)
0 commit comments