#cqrs #event-sourcing #serverless

postgres-es

A Postgres implementation of an event repository for cqrs-es

31 releases

0.4.10 Aug 27, 2023
0.4.9 May 27, 2023
0.4.8 Mar 10, 2023
0.4.5 Aug 16, 2022
0.0.18 May 5, 2020

#225 in Database interfaces

Download history 100/week @ 2023-08-04 81/week @ 2023-08-11 177/week @ 2023-08-18 240/week @ 2023-08-25 277/week @ 2023-09-01 352/week @ 2023-09-08 82/week @ 2023-09-15 153/week @ 2023-09-22 167/week @ 2023-09-29 180/week @ 2023-10-06 216/week @ 2023-10-13 181/week @ 2023-10-20 193/week @ 2023-10-27 171/week @ 2023-11-03 224/week @ 2023-11-10 201/week @ 2023-11-17

804 downloads per month

Apache-2.0

47KB
1K SLoC

postgres-es

A Postgres implementation of the PersistedEventRepository trait in cqrs-es.


Usage

Add to your Cargo.toml file:

[dependencies]
cqrs-es = "0.4.10"
postgres-es = "0.4.10"

Requires access to a Postgres DB with existing tables. See:

A simple configuration example:

let store = default_postgress_pool("postgresql://my_user:my_pass@localhost:5432/my_db");
let cqrs = postgres_es::postgres_cqrs(pool, vec![])

Things that could be helpful:

Runtime and TLS configuration

This package defaults to expect the Tokio runtime and the Rustls library for TLS. If a different combination is desired the appropriate feature flag should be used:

  • runtime-tokio-native-tls
  • runtime-tokio-rustls (default)
  • runtime-async-std-native-tls
  • runtime-async-std-rustls
  • runtime-actix-native-tls
  • runtime-actix-rustls

Crates.io docs docs

Dependencies

~14–26MB
~466K SLoC