From ffa6daf26334893f7c58612aac42617ecce5be5e Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Wed, 26 Nov 2014 01:46:52 -0500 Subject: [PATCH] update readme --- README.md | 56 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index dece27b..7252f3a 100644 --- a/README.md +++ b/README.md @@ -3,28 +3,46 @@ rust-rocksdb * rust wrapper for rocksdb * development began 11/16/14 -* status: minimal functionality with poor style and an annoying interface - -``` -fn f() { - // arguments are path for rocksdb files, create if missing - let db = Rocksdb::open("testdb", true).unwrap(); - db.put(b"a key", b"a value"); - ... - let r = db.get(b"this is key").unwrap(); - db.close(); -} -``` +* status (uncompleted tasks are not ranked by priority): + - [x] basic open/put/get/close + - [x] linux support + - [x] rocksdb itself retrieved and compiled via cargo + - [ ] OSX support + - [ ] windows support + - [ ] batch + - [ ] iterator + - [ ] create/release snapshot + - [ ] range + - [ ] compaction filter, style + - [ ] rustic merge operator + - [ ] comparator + - [ ] slicetransform + - [ ] LRU cache + - [ ] windows support + - [ ] logger + - [ ] column family operations + - [ ] destroy/repair ### running -- get rocksdb +- Cargo.toml ``` -git clone https://github.com/facebook/rocksdb -cd rocksdb -make shared_lib +[dependencies.rocksdb] +git = "https://github.com/spacejam/rust-rocksdb" ``` -- run tests +- Code ``` -LD_PRELOAD=/path/to/rocksdb/librocksdb.so cargo test +extern crate rocksdb; + +fn main() { + let db = rocksdb::open("/path/to/db".to_string(), true).unwrap(); + assert!(db.put(b"hey", b"v1111").is_ok()); + db.get(b"hey").map( |raw| { + std::str::from_utf8(raw.as_slice()).map( |v| { + println!("value: {}", v); + }) + }); + db.close() +} ``` -- enjoy (as much as you can with such a poor current library! stay tuned!) + +- Feedback and pull requests welcome!