@@ -17,7 +17,6 @@ use tikv_client::{raw::Client, Config, Key, KvPair, Result, Value};
17
17
18
18
const KEY : & str = "TiKV" ;
19
19
const VALUE : & str = "Rust" ;
20
- const CUSTOM_CF : & str = "default" ;
21
20
22
21
fn main ( ) -> Result < ( ) > {
23
22
// Create a configuration to use for the example.
@@ -66,14 +65,12 @@ fn main() -> Result<()> {
66
65
// This is *advanced usage* and should have some special considerations.
67
66
client
68
67
. delete ( key. clone ( ) )
69
- . cf ( CUSTOM_CF )
70
68
. wait ( )
71
69
. expect ( "Could not delete value" ) ;
72
70
println ! ( "Key: {:?} deleted" , key) ;
73
71
74
72
client
75
73
. get ( key)
76
- . cf ( CUSTOM_CF )
77
74
. wait ( )
78
75
. expect_err ( "Get returned value for not existing key" ) ;
79
76
@@ -89,7 +86,6 @@ fn main() -> Result<()> {
89
86
90
87
let values = client
91
88
. batch_get ( keys. clone ( ) )
92
- . cf ( CUSTOM_CF )
93
89
. wait ( )
94
90
. expect ( "Could not get values" ) ;
95
91
println ! ( "Found values: {:?} for keys: {:?}" , values, keys) ;
@@ -98,19 +94,10 @@ fn main() -> Result<()> {
98
94
let end: Key = b"k2" . to_vec ( ) . into ( ) ;
99
95
client
100
96
. scan ( start. clone ( ) ..end. clone ( ) , 10 )
101
- . cf ( CUSTOM_CF )
102
97
. key_only ( )
103
98
. wait ( )
104
99
. expect ( "Could not scan" ) ;
105
100
106
- let ranges = vec ! [ start. clone( ) ..end. clone( ) , start. clone( ) ..end. clone( ) ] ;
107
- client
108
- . batch_scan ( ranges, 10 )
109
- . cf ( CUSTOM_CF )
110
- . key_only ( )
111
- . wait ( )
112
- . expect ( "Could not batch scan" ) ;
113
-
114
101
// Cleanly exit.
115
102
Ok ( ( ) )
116
103
}
0 commit comments