In memory serializing to disk Database. Mimics FourthDatabase(C#) and FifthDatabase(C++), SixthDatabase is for Rust using Serde.


Requirements

rust [dependencies] sixth_database = "1.0" serde = { version = "1.0", features = ["derive"] } serde_derive = { version = "1.0"} bincode = {version = "1.0"}

Usage


```rust // If the usage example stops working, look in SixthDatabaseTest's project under main.rs for the current working example.

extern crate sixthdatabase; use sixthdatabase::Database;

fn main() { let example: Arc>> = Database::new("exampledbname");

{
    let mut test = thread_test.lock().expect("Failed to obtain 6db lock");
    test.inner.data.push("test2".to_string());
}

}

/* Explanation:

SixthDatabase is an in memory database, that takes what you place into it and makes it a Vec<String> (For example)
Any type that Serde/Bincode works with, should work with 6DB.

That is then shared with an internal thread that saves the database every 15 seconds (To prevent many constant writes if your data is changing a lot) that hashes your data and to check for the same write, denying the save if it is the same, or letting it write to disk.

The next time you turn on the program, or re-create that database with the same database name, the data is reloaded into a Vec<String> again.

You need to understand how to use Arc and a little bit of threads to use SixthDatabase properly.

Keep your 6DB instance around. If you constantly let the object drop and then create a new instance over and over, it will have to read from the disk for each creation.

*/ ```

Getting help

File a ticket at https://gitlab.com/Wepwawet/sixthdatabase/issues/new

If you use this and want your project to be featured here, open a ticket.