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

Unified Diff: service/datastore/testable.go

Issue 1372473002: Add the ability to disable special automatic entities in impl/memory (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: add more docstring 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 | « impl/memory/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/testable.go
diff --git a/service/datastore/testable.go b/service/datastore/testable.go
index 14e3d8e822f1565148e4f767c0ebc3324fb63863..331156fbd4f7b33f74e3d9441b20a0b6488bdfac 100644
--- a/service/datastore/testable.go
+++ b/service/datastore/testable.go
@@ -57,4 +57,20 @@ type Testable interface {
//
// By default this is false.
AutoIndex(bool)
+
+ // DisableSpecialEntities turns off maintenance of special __entity_group__
+ // type entities. By default this mainenance is enabled, but it can be
+ // disabled by calling this with true.
+ //
+ // If it's true:
+ // - AllocateIDs returns an error.
+ // - Put'ing incomplete Keys returns an error.
+ // - Transactions are disabled and will return an error.
+ //
+ // This is mainly only useful when using an embedded in-memory datastore as
+ // a fully-consistent 'datastore-lite'. In particular, this is useful for the
+ // txnBuf filter which uses it to fulfil queries in a buffered transaction,
+ // but never wants the in-memory versions of these entities to bleed through
+ // to the user code.
+ DisableSpecialEntities(bool)
}
« no previous file with comments | « impl/memory/datastore_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698