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 {
|
if len(path) > 0 {
|
||||||
switch res := val.(type) {
|
switch res := val.(type) {
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
val, _ = e.fetchArray(ctx, res, doc)
|
for k, v := range res {
|
||||||
return val
|
switch val := v.(type) {
|
||||||
|
case *sql.Thing:
|
||||||
|
res[k], _ = e.fetchThing(ctx, val, doc)
|
||||||
|
default:
|
||||||
|
res[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
case *sql.Thing:
|
case *sql.Thing:
|
||||||
val, _ = e.fetchThing(ctx, res, doc)
|
val, _ = e.fetchThing(ctx, res, doc)
|
||||||
return val
|
return val
|
||||||
|
@ -120,8 +127,15 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o
|
||||||
if len(path) > 0 {
|
if len(path) > 0 {
|
||||||
switch res := val.(type) {
|
switch res := val.(type) {
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
val, _ = e.fetchArray(ctx, res, doc)
|
for k, v := range res {
|
||||||
return val
|
switch val := v.(type) {
|
||||||
|
case *sql.Thing:
|
||||||
|
res[k], _ = e.fetchThing(ctx, val, doc)
|
||||||
|
default:
|
||||||
|
res[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
case *sql.Thing:
|
case *sql.Thing:
|
||||||
val, _ = e.fetchThing(ctx, res, doc)
|
val, _ = e.fetchThing(ctx, res, doc)
|
||||||
return val
|
return val
|
||||||
|
|
Loading…
Reference in a new issue