system.stores.VersionedKeyValueStore module¶
Versioned (copy-on-write) key-value store.
- class system.stores.VersionedKeyValueStore.HashableDict[source]¶
Bases:
dictA hashable dictionary class that can be used as a key in a dictionary. In particular, you can create a set of these dictionaries.
- class system.stores.VersionedKeyValueStore.VersionedKeyValueStore(persistence_layer: KeyValueStore = None)[source]¶
Bases:
KeyValueStore[str,object]A versioned store managing key/value mappings.
- class VersionEntry(*, start_validity: int)[source]¶
Bases:
ABC,BaseModelAn abstract class representing a version entry in the store, i.e. an entry of a single object/value plus start_validity information, i.e. when the object was created or updated.
- start_validity: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class UpdateEntry(*, start_validity: int, value: object)[source]¶
Bases:
VersionEntryA class representing an update or creation entry in the store, i.e. an entry of a single object/value plus start_validity information, i.e. when the object was updated or created.
- value: object¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class DeleteEntry(*, start_validity: int)[source]¶
Bases:
VersionEntryA class representing a delete version entry in the store, i.e. just the start_validity information, i.e. since when the object is considered deleted.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class KVStoreEntry(committed: list[VersionEntry], wip: VersionEntry | None = None)[source]¶
Bases:
objectA class representing a key value store entry.
- committed: list[VersionEntry]¶
- wip: VersionEntry | None = None¶
- put(object_id: str, _object: object) None | PutInfo[source]¶
See
Index.put().Non-transactional insert: the object is deep-copied and recorded as a single committed version with start timestamp 0, bypassing the store’s transactional semantics (use
TransactionalKeyValueStorefor those). Raises if the object_id already exists.
- get(object_id: str) Iterator[object][source]¶
See
PointQueryMixIn.get().Yields only the value of the most recent committed version; delete markers are not taken into account. Raises if the object_id is not present.
- delete(object_id: str, _object: object = None) None[source]¶
See
Index.delete().Non-transactional delete: requires
_objectto be None and appends a delete marker as a committed version with start timestamp 0. Raises if the object_id is not present.