Work in progress

- The eager loading is behaving correctly now
This commit is contained in:
Aaron L 2016-09-28 19:57:38 -07:00
parent b0182bead7
commit e625589ed1
3 changed files with 215 additions and 198 deletions
queries

View file

@ -110,20 +110,10 @@ func (q *Query) Bind(obj interface{}) error {
return res
}
if len(q.load) == 0 {
return nil
if len(q.load) != 0 {
return eagerLoad(q.executor, q.load, obj, bkind)
}
state := loadRelationshipState{
exec: q.executor,
loaded: map[string]struct{}{},
}
for _, toLoad := range q.load {
state.toLoad = strings.Split(toLoad, ".")
if err = state.loadRelationships(0, obj, bkind); err != nil {
return err
}
}
return nil
}