Only use remote iterator fetch, if the value is a record
This commit is contained in:
parent
b6bf75c7b5
commit
f8beab1e17
1 changed files with 18 additions and 4 deletions
22
db/fetch.go
22
db/fetch.go
|
@ -92,8 +92,15 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o
|
|||
if len(path) > 0 {
|
||||
switch res := val.(type) {
|
||||
case []interface{}:
|
||||
val, _ = e.fetchArray(ctx, res, doc)
|
||||
return val
|
||||
for k, v := range res {
|
||||
switch val := v.(type) {
|
||||
case *sql.Thing:
|
||||
res[k], _ = e.fetchThing(ctx, val, doc)
|
||||
default:
|
||||
res[k] = v
|
||||
}
|
||||
}
|
||||
return res
|
||||
case *sql.Thing:
|
||||
val, _ = e.fetchThing(ctx, res, doc)
|
||||
return val
|
||||
|
@ -120,8 +127,15 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o
|
|||
if len(path) > 0 {
|
||||
switch res := val.(type) {
|
||||
case []interface{}:
|
||||
val, _ = e.fetchArray(ctx, res, doc)
|
||||
return val
|
||||
for k, v := range res {
|
||||
switch val := v.(type) {
|
||||
case *sql.Thing:
|
||||
res[k], _ = e.fetchThing(ctx, val, doc)
|
||||
default:
|
||||
res[k] = v
|
||||
}
|
||||
}
|
||||
return res
|
||||
case *sql.Thing:
|
||||
val, _ = e.fetchThing(ctx, res, doc)
|
||||
return val
|
||||
|
|
Loading…
Reference in a new issue