Event Sourcing tools
These classes are just given for reference. They are pretty straight-forward and you probably will implement them yourself instead of using these.
depeche_db.event_sourcing.EventSourcedAggregateRoot
Bases: ABC
, Generic[ID, E]
Source code in depeche_db/event_sourcing/aggregate_root.py
depeche_db.event_sourcing.Repo
Bases: ABC
, Generic[OBJ, ID]
A repository is a collection of objects that can be queried and persisted.
This is an abstract base class that defines the interface that all repositories implement.
add(entity)
abstractmethod
Add a new entity to the repository.
get(id)
abstractmethod
Get an entity from the repository by its ID.
save(entity, expected_version)
abstractmethod
Save an existing entity to the repository.
depeche_db.event_sourcing.EventStoreRepo
Bases: Generic[E, OBJ, ID]
, Repo[OBJ, ID]