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

Unified Diff: service/datastore/raw_interface.go

Issue 1357343002: Add missing AllocateIDs API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: add panic 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
« no previous file with comments | « service/datastore/interface.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/raw_interface.go
diff --git a/service/datastore/raw_interface.go b/service/datastore/raw_interface.go
index 8526cd270090233e47fd5ea60c59884f379b36d3..8c385472dc93a1d9cd07aaa4913afb70491fb9ff 100644
--- a/service/datastore/raw_interface.go
+++ b/service/datastore/raw_interface.go
@@ -99,8 +99,16 @@ func (m MultiMetaGetter) GetSingle(idx int) MetaGetter {
// RawInterface implements the datastore functionality without any of the fancy
// reflection stuff. This is so that Filters can avoid doing lots of redundant
-// reflection work. See datastore.RawInterface for a more user-friendly interface.
+// reflection work. See datastore.Interface for a more user-friendly interface.
type RawInterface interface {
+ // AllocateIDs allows you to allocate IDs from the datastore without putting
+ // any data. `incomplete` must be a PartialValid Key. If there's no error,
+ // a contiguous block of IDs of n length starting at `start` will be reserved
+ // indefinitely for the user application code for use in new keys. The
+ // appengine automatic ID generator will never automatically assign these IDs
+ // for Keys of this type.
+ AllocateIDs(incomplete *Key, n int) (start int64, err error)
+
// RunInTransaction runs f in a transaction.
//
// opts may be nil.
« no previous file with comments | « service/datastore/interface.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698