simplebase

A simple to use database library

Documentation

There is extensive documentation included with the source code and it can be rendered to html by running the 'cargo doc' from in the relevant directory of your project. It will be saved in the target/doc section of your project.

Usage

Add this to your Cargo.toml:

toml [dependencies] simplebase = "0.3.0"

The idea behind this crate is to have simple database capabilities for a project. It is also designed to be extremely easy to use and to have thorough documentation with lots of examples. An example session would be as follows:

```rust

extern crate simplebase; use simplebase::engine::*;

fn main() { let mut database = newemptydatabase();

database.addrecordwithkey("mob".tostring(), "0404111222".to_string());

database.addrecord("This is a test".tostring()); database.addrecord(0.23423 as f32); database.addrecord(0.23423 as f64); database.addrecord(23423 as u32); database.addrecord(23423 as u64); database.addrecord(-23423 as i32); database.addrecord(-23423 as i64);

database.addrecord("Sam goes to the greatest market 1".tostring()); database.addrecord("Sam goes to the greatest market 2".tostring()); database.addrecord("Sam goes to the greatest market 3".tostring()); database.addrecord("Sam goes to the greatest market 4".tostring()); database.addrecord("Sam goes to the greatest market 5".tostring()); database.addrecordwithkey("mob".tostring(), "0404111222".tostring()); database.addrecordwithkey("test".tostring(), "Sam goes to the greatest market 5".tostring()); database.save_database("test5base.txt");

let loadeddatabasereadonly = loadhashdatabasereadonly("test5base.txt"); let _result = loadeddatabasereadonly.find("greatest"); let result2 = loadeddatabasereadonly.getrecord(4); database.deleterecord(4); let result3 = database.getrecord(4); database.save_database("test5base.txt");

}

``` This latest release adds some minor breaking changes but I considered them important. The first is that file locking has been introduced for saves, this means the fs2 crate is now used. The second is that if a database.get_record(23423) is made, and the record does not exist, a "None" is now returned instead of an empty string. I also added a few more functions to the test suite.

License

This project is licensed under either of