| Index: impl/memory/datastore.go
|
| diff --git a/impl/memory/datastore.go b/impl/memory/datastore.go
|
| index 857b06e307a686b38eef483c4e650fb3467ea6b3..df95cb115e38f43672b2330ba0c36d8f1094da80 100644
|
| --- a/impl/memory/datastore.go
|
| +++ b/impl/memory/datastore.go
|
| @@ -69,10 +69,12 @@ 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 {
|
| - return err // will be nil if done
|
| + _, err := q.(*queryImpl).prep(d.ns, true)
|
| + if err != nil {
|
| + if err == errQueryDone {
|
| + return nil
|
| + }
|
| + return err
|
| }
|
| return nil
|
| }
|
| @@ -142,16 +144,16 @@ 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)
|
| - done, err := rq.valid(d.ns, true)
|
| - if done || err != nil {
|
| - return err // will be nil if done
|
| + _, err := q.(*queryImpl).prep(d.ns, true)
|
| + if err != nil {
|
| + if err == errQueryDone {
|
| + return nil
|
| + }
|
| + return err
|
| }
|
| - if rq.eventualConsistency {
|
| - rq = rq.checkMutateClone(nil, nil)
|
| - rq.eventualConsistency = false
|
| + if q.(*queryImpl).eventualConsistency {
|
| + // TODO(riannucci): use head instead of snap for indexes
|
| }
|
| - // TODO(riannucci): use head instead of snap for indexes
|
| panic("NOT IMPLEMENTED")
|
| }
|
|
|
|
|