Event sourcing.rs
It is an opinionated library used to achieve cqrs/es in Rust.
A set of example snippets can be found in the example
folder.
Install
Event Sourcing RS uses under the hood sqlx
.
# Cargo.toml
[]
# postgres database
= { = "0.6", = ["postgres"] }
= { = "0.6", = ["postgres", "runtime-tokio-native-tls", "uuid", "json", "chrono"] }
Tracing
A tracing span is produced every time a projector is used or a policy is applied to a given event.
Run examples, tests and linting
Start a Postgres instance.
docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgres -d postgres:11-alpine
Export DATABASE_URL environment variable with freshly new created database.
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
Run tests.
cargo test --all-targets --all-features
Run linters.
cargo clippy --all-targets --all-features -- -W clippy::nursery
Finally eventually unset DATABASE_URL
environment variable.
unset DATABASE_URL