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

Unified Diff: service/datastore/interface.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/interface.go
diff --git a/service/datastore/interface.go b/service/datastore/interface.go
index c52e8b02010918c4704c7cc40439e8633006bed7..624d5d0bd0d01232357ea7977fa6b7e420e67d48 100644
--- a/service/datastore/interface.go
+++ b/service/datastore/interface.go
@@ -100,6 +100,11 @@ type Interface interface {
// Run stops on the first error encountered.
Run(q *Query, cb interface{}) error
+ // Count is a convenience method to count the number of results that a query
+ // has. It does this by running the keys-only version of q and counting. No
+ // magic here.
+ Count(q *Query) (int64, error)
Vadim Sh. 2015/09/24 18:40:11 Is it how ndb's count() work? I though there IS ma
iannucci 2015/09/24 18:59:30 So I took a look... it seems like there's actually
+
// DecodeCursor converts a string returned by a Cursor into a Cursor instance.
// It will return an error if the supplied string is not valid, or could not
// be decoded by the implementation.

Powered by Google App Engine
This is Rietveld 408576698