9 releases
0.1.0 | Dec 13, 2022 |
---|---|
0.0.8 | Jun 20, 2021 |
0.0.6 | Apr 14, 2021 |
#2419 in Database interfaces
33 downloads per month
67KB
1K
SLoC
Message DB
Rust Client for the Microservice Native Event Store and Message Store for Postgres
A fully-featured event store and message store implemented in PostgreSQL for Pub/Sub, Event Sourcing, Messaging, and Evented Microservices applications.
For more information, see the Message DB project page. https://github.com/message-db/message-db
License
This project is licensed under the MIT OR Apache-2.0 license.
Contributing
Contributions are welcome!
lib.rs
:
Message DB
Rust Client for the Microservice Native Event Store and Message Store for Postgres
A fully-featured event store and message store implemented in PostgreSQL for Pub/Sub, Event Sourcing, Messaging, and Evented Microservices applications.
For more information, see the Message DB project page. https://github.com/message-db/message-db
Example
use message_db::database::{MessageStore, WriteMessageOpts};
use serde_json::json;
// Connect to MessageDb
let message_store = MessageStore::connect("postgres://postgres:password@localhost:5432/postgres").await?;
// Get last stream message
let last_message = MessageStore::get_last_stream_message(&message_store, "account-123", None).await?;
// Write message
let last_message = MessageStore::write_message(
&message_store,
"account-123",
"AccountOpened",
&json!({ "initial_balance": 0 }),
&WriteMessageOpts::default(),
).await?;
Dependencies
~2–15MB
~206K SLoC