#in-memory #adaptor #nitinol

nitinol-inmemory-adaptor

In-memory storage adapter for nitinol-persistence

1 unstable release

0.1.0 Mar 25, 2025

#975 in Database interfaces

Download history 60/week @ 2025-03-19 50/week @ 2025-03-26

110 downloads per month

MIT license

16KB
303 lines

nitinol-inmemory-adaptor

This is a simple adaptor to use Nitinol with inmemory database.

Caution

This in-memory adapter loses data when the program is terminated. (of course)
It should only be used to test the library and do not be used into production.

Usage

#[tokio::main]
async fn main() {
    let eventstore = InMemoryEventStore::default();
    let writer = EventWriter::new(eventstore).set_retry(5);
    
    // Install as global writer.
    nitinol::setup::set_writer(writer);
}

Dependencies

~3.5–9.5MB
~87K SLoC