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

Unified Diff: service/datastore/datastore.go

Issue 1366793002: Add Consistent(bool) to Testing interface (Closed) Base URL: https://github.com/luci/gae.git@move_serialization_helpers
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: service/datastore/datastore.go
diff --git a/service/datastore/datastore.go b/service/datastore/datastore.go
index 195df7871a2604d741010175a8f4636b9b64f109..8c7453a80836b86c7d5323b1c911682d935753db 100644
--- a/service/datastore/datastore.go
+++ b/service/datastore/datastore.go
@@ -108,6 +108,15 @@ func (d *datastoreImpl) Run(q *Query, cbIface interface{}) error {
return err
}
+func (d *datastoreImpl) Count(q *Query) (int64, error) {
Vadim Sh. 2015/09/24 18:40:11 this doesn't belong to this CL..
iannucci 2015/09/24 18:59:30 Ok, I'll pull it out.
+ ret := int64(0)
+ err := d.Run(q, func(_ *Key, _ CursorCB) bool {
+ ret++
+ return true
+ })
+ return ret, err
+}
+
func (d *datastoreImpl) GetAll(q *Query, dst interface{}) error {
v := reflect.ValueOf(dst)
if v.Kind() != reflect.Ptr {

Powered by Google App Engine
This is Rietveld 408576698