use grebedb::{Database, Options};
fn main() -> Result<(), grebedb::Error> {
let path = std::path::PathBuf::from("grebedb_example_data/get_put_remove/");
std::fs::create_dir_all(&path)?;
let options = Options::default();
let mut db = Database::open_path(path, options)?;
db.put("key:1", "hello world 1!")?;
db.put("key:2", "hello world 2!")?;
db.put("key:3", "hello world 3!")?;
println!("The value of key1 is {:?}", db.get("key:1")?);
println!("The value of key2 is {:?}", db.get("key:2")?);
println!("The value of key3 is {:?}", db.get("key:3")?);
db.put("key:2", "new value")?;
println!("The value of key2 is {:?}", db.get("key:2")?);
db.remove("key:2")?;
println!("The value of key2 is {:?}", db.get("key:2")?);
db.flush()?;
Ok(())
}