Update readme, bump version.

master
Tyler Neely 9 years ago
parent 064ddec8ea
commit 705420aa69
  1. 2
      Cargo.toml
  2. 18
      README.md

@ -2,7 +2,7 @@
name = "rocksdb" name = "rocksdb"
description = "A Rust wrapper for Facebook's RocksDB embeddable database." description = "A Rust wrapper for Facebook's RocksDB embeddable database."
version = "0.1.1" version = "0.2.0"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"] authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
license = "Apache-2.0" license = "Apache-2.0"
keywords = ["database", "embedded", "LSM-tree", "persistence"] keywords = ["database", "embedded", "LSM-tree", "persistence"]

@ -3,7 +3,7 @@ rust-rocksdb
[![Build Status](https://travis-ci.org/spacejam/rust-rocksdb.svg?branch=master)](https://travis-ci.org/spacejam/rust-rocksdb) [![Build Status](https://travis-ci.org/spacejam/rust-rocksdb.svg?branch=master)](https://travis-ci.org/spacejam/rust-rocksdb)
[![crates.io](http://meritbadge.herokuapp.com/rocksdb)](https://crates.io/crates/rocksdb) [![crates.io](http://meritbadge.herokuapp.com/rocksdb)](https://crates.io/crates/rocksdb)
This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.1.1 crate should work with the Rust 1.2 stable and nightly releases as of 9/7/15. This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.2.0 crate should work with the Rust 1.4 stable and nightly releases as of 11/7/15.
### status ### status
- [x] basic open/put/get/delete/close - [x] basic open/put/get/delete/close
@ -16,6 +16,7 @@ This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.1.1
- [x] comparator - [x] comparator
- [x] snapshot - [x] snapshot
- [x] column family operations - [x] column family operations
- [ ] prefix seek
- [ ] slicetransform - [ ] slicetransform
- [ ] windows support - [ ] windows support
@ -35,7 +36,7 @@ sudo make install
###### Cargo.toml ###### Cargo.toml
```rust ```rust
[dependencies] [dependencies]
rocksdb = "~0.1.1" rocksdb = "~0.2.0"
``` ```
###### Code ###### Code
```rust ```rust
@ -45,12 +46,11 @@ use rocksdb::{DB, Writable};
fn main() { fn main() {
let mut db = DB::open_default("/path/for/rocksdb/storage").unwrap(); let mut db = DB::open_default("/path/for/rocksdb/storage").unwrap();
db.put(b"my key", b"my value"); db.put(b"my key", b"my value");
db.get(b"my key") match db.get(b"my key") {
.map( |value| { Ok(Some(value)) => println!("retrieved value {}", value.to_utf8().unwrap()),
println!("retrieved value {}", value.to_utf8().unwrap()) Ok(None) => println!("value not found"),
}) Err(e) => println!("operational problem encountered: {}", e),
.on_absent( || { println!("value not found") }) }
.on_error( |e| { println!("operational problem encountered: {}", e) });
db.delete(b"my key"); db.delete(b"my key");
} }
@ -141,7 +141,7 @@ fn main() {
db.merge(b"k1", b"d"); db.merge(b"k1", b"d");
db.merge(b"k1", b"efg"); db.merge(b"k1", b"efg");
let r = db.get(b"k1"); let r = db.get(b"k1");
assert!(r.unwrap().to_utf8().unwrap() == "abcdefg"); assert!(r.unwrap().unwrap().to_utf8().unwrap() == "abcdefg");
} }
``` ```

Loading…
Cancel
Save