#key-value-database #queries #pair #optimized #tokio #firefly #ffly

ffly-rs

A rust utility library for the Firefly key-value pair database

7 releases

0.0.6 Feb 11, 2023
0.0.5 Oct 25, 2022
0.0.2 Aug 13, 2022

#1224 in Database interfaces

Download history 13/week @ 2024-02-20 4/week @ 2024-02-27 2/week @ 2024-03-05 18/week @ 2024-03-12 10/week @ 2024-03-26 41/week @ 2024-04-02

51 downloads per month

MIT license

10KB
111 lines

Firefly Rust library

A utility library to provide optimized queries for the Firefly library.

Using the library

The crate can be found at crates.io ffly-rs.

Example

use ffly_rs::FireflyStream;

static FIREFLY_ADDR: &'static str = "127.0.0.1:46600";

#[tokio::main]
async fn main() {
    let mut firefly = FireflyStream::connect(FIREFLY_ADDR)
        .await
        .expect("Could not connect to Firefly server!");

    firefly.default_ttl = 60 * 60 * 24 * 7; // 7 days
    firefly
        .new("key", "value")
        .await
        .expect("Could not create a new record!");

    assert_eq!(
        firefly
            .get_value("key")
            .await
            .expect("Could not get value!"),
        "value"
    );
}

Dependencies

~2.4–8.5MB
~57K SLoC