Chromium Code Reviews| Index: impl/memory/datastore.go |
| diff --git a/impl/memory/datastore.go b/impl/memory/datastore.go |
| index 53e72be7ec9a424817465115a894ea1cfd845554..8af720030bf7a489c6b3915b90210dc13691636d 100644 |
| --- a/impl/memory/datastore.go |
| +++ b/impl/memory/datastore.go |
| @@ -68,6 +68,11 @@ func (d *dsImpl) NewQuery(kind string) ds.Query { |
| } |
| func (d *dsImpl) Run(q ds.Query, cb ds.RawRunCB) error { |
| + rq := q.(*queryImpl) |
| + done, err := rq.valid(d.ns, true) |
| + if done || err != nil { |
|
dnj (Google)
2015/08/14 21:01:34
What's the value of "done"? From what I can see, y
iannucci
2015/08/14 22:25:47
it's in case the user specified a query with zero
dnj (Google)
2015/08/14 22:58:13
Acknowledged.
|
| + return err // will be nil if done |
| + } |
| return nil |
| } |
| @@ -137,11 +142,12 @@ func (d *txnDsImpl) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error { |
| func (d *txnDsImpl) Run(q ds.Query, cb ds.RawRunCB) error { |
| rq := q.(*queryImpl) |
| - if rq.ancestor == nil { |
| - return errors.New("gae/impl/memory: queries in transactions only support ancestor queries") |
| + done, err := rq.valid(d.ns, true) |
| + if done || err != nil { |
| + return err // will be nil if done |
| } |
| if rq.eventualConsistency { |
| - rq = rq.clone() |
| + rq = rq.checkMutateClone(nil, nil) |
| rq.eventualConsistency = false |
| } |
| // TODO(riannucci): use head instead of snap for indexes |