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

Unified Diff: service/datastore/interface.go

Issue 1398103003: Add Exists and ExistsMulti convenience methods (Closed) Base URL: https://github.com/luci/gae.git@add_version_id
Patch Set: Created 5 years, 2 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
« service/datastore/datastore.go ('K') | « service/datastore/datastore_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/interface.go
diff --git a/service/datastore/interface.go b/service/datastore/interface.go
index d4afa69a6b9a487d413476878665c3759fea2a07..d68314108c7175262f03dbef1128cd75f8e14f9f 100644
--- a/service/datastore/interface.go
+++ b/service/datastore/interface.go
@@ -118,6 +118,14 @@ type Interface interface {
// - *[]*Key implies a keys-only query.
GetAll(q *Query, dst interface{}) error
+ // Does a Get for this key and returns true iff it exists. Will only return
Vadim Sh. 2015/10/13 04:05:57 Exists does a get ... Also explain why it is bette
+ // an error if it's not ErrNoSuchEntity
+ Exists(k *Key) (bool, error)
+
+ // Does a GetMulti for thes keys and returns true iff they exist. Will only
+ // return an error if it's not ErrNoSuchEntity
+ ExistsMulti(k []*Key) ([]bool, error)
Vadim Sh. 2015/10/13 04:05:57 same here
+
// Get retrieves a single object from the datastore
//
// dst must be one of:
« service/datastore/datastore.go ('K') | « service/datastore/datastore_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698