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

Unified Diff: filter/featureBreaker/rds.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: filter/featureBreaker/rds.go
diff --git a/filter/featureBreaker/rds.go b/filter/featureBreaker/rds.go
index 2ff6c82231c8f71477cdb3719cdcf0feb508adda..c3fa44f56cde1bc9f5103dbc563939de0a012af2 100644
--- a/filter/featureBreaker/rds.go
+++ b/filter/featureBreaker/rds.go
@@ -40,6 +40,15 @@ func (r *dsState) Run(q *ds.FinalizedQuery, cb ds.RawRunCB) error {
})
}
+func (r *dsState) Count(q *ds.FinalizedQuery) (int64, error) {
+ count := int64(0)
+ err := r.run(func() (err error) {
+ count, err = r.rds.Count(q)
+ return
+ })
+ return count, err
+}
+
func (r *dsState) RunInTransaction(f func(c context.Context) error, opts *ds.TransactionOptions) error {
return r.run(func() error {
return r.rds.RunInTransaction(f, opts)

Powered by Google App Engine
This is Rietveld 408576698