#events #store #stream #deal #aspect #event-sourcing #uuid

event_store

Crate to deal with every aspect of an eventstore

2 releases

0.1.1 Sep 11, 2021
0.1.0 Jul 20, 2020

#5 in #aspect

40 downloads per month
Used in chekov

MIT license

82KB
2K SLoC

EventStore

The EventStore will allow you to deal with every aspects of the event sourcing part of Chekov.

Appending an event

Events are appended by using the fluent API exposed at the root level of the event_store crate:

use event_store::prelude::*;
#

let stream_uuid = Uuid::new_v4().to_string();
let my_event = MyEvent { account_id: Uuid::new_v4() };

event_store::append()
  .event(&my_event)?
  .to(&stream_uuid)?
  .execute(event_store)
  .await;

Reading from stream

A Stream can be read with the fluent API exposed at the root level of the event_store crate:

use event_store::prelude::*;
#

let stream_uuid = Uuid::new_v4().to_string();

event_store::read()
  .stream(&stream_uuid)?
  .from(ReadVersion::Origin)
  .limit(10)
  .execute(event_store)
  .await;

Dependencies

~17–31MB
~543K SLoC