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

Unified Diff: service/datastore/interface.go

Issue 1367003002: Add missing Count api (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..d4afa69a6b9a487d413476878665c3759fea2a07 100644
--- a/service/datastore/interface.go
+++ b/service/datastore/interface.go
@@ -100,6 +100,10 @@ type Interface interface {
// Run stops on the first error encountered.
Run(q *Query, cb interface{}) error
+ // Count executes the given query and returns the number of entries which
+ // match it.
+ Count(q *Query) (int64, error)
+
// 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