Chromium Code Reviews| 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 { |