Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now available in preview.

Module: google.appengine.datastore.datastore_stub_util

Utility functions shared between the file and sqlite datastore stubs.

This module is internal and should not be used by client applications.


class BaseConsistencyPolicy: A base class for a consistency policy to be used with a transaction manger.

class BaseCursor: A base query cursor over a list of entities.

class BaseDatastore: A base implementation of a Datastore.

class BaseHighReplicationConsistencyPolicy: A base class for High Replication Datastore consistency policies.

class BaseIndexManager: A generic index manager that stores all data in memory.

class BaseTransactionManager: A class that manages the state of transactions.

class DatastoreStub: A stub that maps datastore service calls on to a BaseDatastore.

class EntityGroupMetaData: The meta_data assoicated with an entity group.

class EntityGroupPseudoKind: A common implementation of get() for the entity_group pseudo-kind.

class EntityGroupTracker: An entity group involved a transaction.

class EntityRecord: An EntityProto and its associated EntityMetadata protobuf.

class ListCursor: A query cursor over a list of entities.

class LiveTxn: An in flight transaction.

class MasterSlaveConsistencyPolicy: Enforces the Master / Slave consistency policy.

class PseudoRandomHRConsistencyPolicy: A policy that always gives the same sequence of consistency decisions.

class StubQueryConverter: Converter for v3, v4 and v1 queries suitable for use in stubs.

class StubServiceConverter: Converter for v3/v4/v1 request/response protos suitable for use in stubs.

class TimeBasedHRConsistencyPolicy: A High Replication Datastore consistency policy based on elapsed time.

class ValueRange: A range of values defined by its two extremes (inclusive or exclusive).


Check(...): Raises an apiproxy_errors.ApplicationError if the condition is false.

CheckAppId(...): Check that this is the stub for app_id.

CheckEntity(...): Check if this entity can be stored.

CheckProperty(...): Check if this property can be stored.

CheckPropertyValue(...): Check if this property value can be stored.

CheckQuery(...): Check a datastore query with normalized filters, orders.

CheckReference(...): Check this key.

CheckTransaction(...): Check that this transaction is valid.

CheckValidUTF8(...): Check that the given string is valid UTF-8.

CompareEntityPbByKey(...): Compare two entity protobuf's by key.

FillUser(...): Fill in a synthetic user ID for a user properties.

FillUsersInQuery(...): Fill in a synthetic user ID for all user properties in a set of filters.

GetInvisibleSpecialPropertyNames(...): Gets the names of all non user-visible special properties.

IdToCounter(...): Map ID k to the counter value from which it was generated.

LoadEntity(...): Prepares an entity to be returned to the user.

LoadRecord(...): Prepares a record to be returned to the user.

NormalizeCursors(...): Normalizes compiled cursors in place.

ParseKeyFilteredQuery(...): Parse queries which only allow filters and ascending-orders on key.

ParseKindQuery(...): Parse kind (schema) queries.

ParseNamespaceQuery(...): Parse namespace queries.

ParsePropertyQuery(...): Parse property queries.

PrepareSpecialPropertiesForLoad(...): Computes special properties that are user-visible.

PrepareSpecialPropertiesForStore(...): Computes special properties for storing.

ReverseBitsInt64(...): Reverse the bits of a 64-bit integer.

StoreRecord(...): Prepares a record for storing.

SynthesizeUserId(...): Return a synthetic user ID from an email address.

ToScatteredId(...): Map counter value v to the scattered ID space.

UpdateEmulatorConfig(...): Update the cloud datastore emulator's config with its client side cache.

get_query_converter(...): Returns a converter for v3 and v1 queries (not suitable for production).

get_service_converter(...): Returns a converter for v3 and v1 service request/response protos.

SCATTERED 'scattered'
SEQUENTIAL 'sequential'
logger Instance of logging.Logger