40 releases (7 stable)

new 2.0.0-beta.6 Jan 22, 2025
2.0.0-beta.3 Mar 24, 2024
2.0.0-beta.2 Feb 20, 2024
2.0.0-beta.0 May 23, 2023
0.1.0 Jun 18, 2022

#151 in Database interfaces

Download history 3/week @ 2024-11-03 2/week @ 2024-12-08 1/week @ 2024-12-15 107/week @ 2025-01-19

107 downloads per month

MIT license

82KB
2K SLoC

crates.io docs.rs

DustData

A data concurrency control storage engine to Rustbase

Join our community and chat with other Rust users.

⚠️ Warning

This is a work in progress. The API is not stable yet.

🔗 Contribute

Click here to see how to Contribute

How to install

Add the following to your Cargo.toml:

[dependencies]
dustdata = "2.0.0-beta.6"

Usage

Initialize a new DustData instance with the default configuration:

use dustdata::DustData;

let mut dustdata = DustData::new(Default::default()).unwrap();

Inserting data into a collection

#[derive(Serialize, Deserialize, Clone, Debug)]
struct User {
    name: String,
    age: u32,
}

let collection = dustdata.collection::<User>("users");

let user = User {
    name: "Pedro".to_string(),
    age: 21,
};

// Creating a new transaction.
let mut transaction = collection.start_branch();

// Inserting the user into the transaction.
transaction.insert("user:1", user);

// Committing the transaction.
collection.commit(transaction).unwrap();

// Done!

Reading data from a collection

let collection = dustdata.collection::<User>("users").unwrap();

let user = collection.get("user:1").unwrap();

Authors

License

MIT License

Dependencies

~1.1–2MB
~39K SLoC