postgres_es2/framework/
postgres_snapshot_cqrs.rs1use cqrs_es2::{
2 Aggregate,
3 CqrsFramework,
4 QueryProcessor,
5};
6use postgres::Client;
7
8use crate::aggregates::{
9 PostgresSnapshotStore,
10 PostgresSnapshotStoreAggregateContext,
11};
12
13pub type PostgresSnapshotCqrs<A> = CqrsFramework<
17 A,
18 PostgresSnapshotStore<A>,
19 PostgresSnapshotStoreAggregateContext<A>,
20>;
21
22pub fn postgres_snapshot_cqrs<A>(
25 conn: Client,
26 query_processor: Vec<Box<dyn QueryProcessor<A>>>,
27) -> PostgresSnapshotCqrs<A>
28where
29 A: Aggregate, {
30 let store = PostgresSnapshotStore::new(conn);
31 CqrsFramework::new(store, query_processor)
32}