Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1253)

Side by Side Diff: impl/memory/datastore.go

Issue 1894403002: datastore: Fix AddIndexes with existing namespaces (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | impl/memory/datastore_data.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if len(idxs) == 0 { 123 if len(idxs) == 0 {
124 return 124 return
125 } 125 }
126 126
127 for _, i := range idxs { 127 for _, i := range idxs {
128 if !i.Compound() { 128 if !i.Compound() {
129 panic(fmt.Errorf("Attempted to add non-compound index: % s", i)) 129 panic(fmt.Errorf("Attempted to add non-compound index: % s", i))
130 } 130 }
131 } 131 }
132 132
133 » d.data.addIndexes(d.ns, idxs) 133 » d.data.addIndexes(idxs)
134 } 134 }
135 135
136 func (d *dsImpl) TakeIndexSnapshot() ds.TestingSnapshot { 136 func (d *dsImpl) TakeIndexSnapshot() ds.TestingSnapshot {
137 return d.data.takeSnapshot() 137 return d.data.takeSnapshot()
138 } 138 }
139 139
140 func (d *dsImpl) SetIndexSnapshot(snap ds.TestingSnapshot) { 140 func (d *dsImpl) SetIndexSnapshot(snap ds.TestingSnapshot) {
141 d.data.setSnapshot(snap.(*memStore)) 141 d.data.setSnapshot(snap.(*memStore))
142 } 142 }
143 143
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 return countQuery(fq, d.data.parent.aid, d.ns, true, d.data.snap, d.data .snap) 218 return countQuery(fq, d.data.parent.aid, d.ns, true, d.data.snap, d.data .snap)
219 } 219 }
220 220
221 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio nOptions) error { 221 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio nOptions) error {
222 return errors.New("datastore: nested transactions are not supported") 222 return errors.New("datastore: nested transactions are not supported")
223 } 223 }
224 224
225 func (*txnDsImpl) Testable() ds.Testable { 225 func (*txnDsImpl) Testable() ds.Testable {
226 return nil 226 return nil
227 } 227 }
OLDNEW
« no previous file with comments | « no previous file | impl/memory/datastore_data.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698