0.1.0 |
|
---|
#6 in #postgre-sql
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! :baloon:
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
~208K SLoC