Crate cqrs_es2_store[][src]

Expand description

Sync implementation of the cqrs-es2 store.

Provides sync interfaces to different database implementations for the CQRS system store.

Design

The main components of this library are:

  • IEventDispatcher - an interface for sync events listeners
  • IEventStore - an interface for sync event stores
  • IQueryStore - an interface for sync query stores

Features

  • with-postgres - sync Postgres store
  • with-mysql - sync MySQL store
  • with-sqlite - sync SQLite store
  • with-all-sql - all SQL drivers
  • with-mongodb - sync MongoDB store
  • with-all-doc-db - all doc DBs drivers
  • with-redis - sync Redis store
  • with-all-kv-db - all key-value DBs drivers
  • with-all-sync - all sync drivers (default)

Installation

To use this library in a sync application, add the following to your dependency section in the project’s Cargo.toml:

[dependencies]
log = { version = "^0.4", features = [
  "max_level_debug",
  "release_max_level_warn",
] }
fern = "^0.5"

serde = { version = "^1.0.127", features = ["derive"] }
serde_json = "^1.0.66"

cqrs-es2 = { version = "*"}

cqrs-es2-store = { version = "*", default-features = false, features = [
  "with-postgres",
] }

postgres = { version = "^0.19.1", features = ["with-serde_json-1"] }

Usage

A full sync store example application is available here.

Modules

A simple memory store for testing purposes only

MongoDB store

Postgres store

Postgres store

Redis store

SQLite store

Structs

This is the base framework for applying commands to produce events.

Traits

Event dispatcher are usually the query stores. It updates its query with the emitted events.

The abstract central source for loading past events and committing new events.

The abstract central source for loading and committing queries.