Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions examples/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use tikv_client::{raw::Client, Config, Key, KvPair, Result, Value};

const KEY: &str = "TiKV";
const VALUE: &str = "Rust";
const CUSTOM_CF: &str = "default";

fn main() -> Result<()> {
// Create a configuration to use for the example.
Expand Down Expand Up @@ -66,14 +65,12 @@ fn main() -> Result<()> {
// This is *advanced usage* and should have some special considerations.
client
.delete(key.clone())
.cf(CUSTOM_CF)
.wait()
.expect("Could not delete value");
println!("Key: {:?} deleted", key);

client
.get(key)
.cf(CUSTOM_CF)
.wait()
.expect_err("Get returned value for not existing key");

Expand All @@ -89,7 +86,6 @@ fn main() -> Result<()> {

let values = client
.batch_get(keys.clone())
.cf(CUSTOM_CF)
.wait()
.expect("Could not get values");
println!("Found values: {:?} for keys: {:?}", values, keys);
Expand All @@ -98,19 +94,10 @@ fn main() -> Result<()> {
let end: Key = b"k2".to_vec().into();
client
.scan(start.clone()..end.clone(), 10)
.cf(CUSTOM_CF)
.key_only()
.wait()
.expect("Could not scan");

let ranges = vec![start.clone()..end.clone(), start.clone()..end.clone()];
client
.batch_scan(ranges, 10)
.cf(CUSTOM_CF)
.key_only()
.wait()
.expect("Could not batch scan");

// Cleanly exit.
Ok(())
}