mirror of https://github.com/tikv/client-rust.git
Update client initialization in README (#503)
Signed-off-by: Benjamin Kane <92759008+bkane-msft@users.noreply.github.com>
This commit is contained in:
parent
76959e7523
commit
691df4d95a
|
@ -33,7 +33,7 @@ Raw mode:
|
|||
```rust
|
||||
use tikv_client::RawClient;
|
||||
|
||||
let client = RawClient::new(vec!["127.0.0.1:2379"], None).await?;
|
||||
let client = RawClient::new(vec!["127.0.0.1:2379"]).await?;
|
||||
client.put("key".to_owned(), "value".to_owned()).await?;
|
||||
let value = client.get("key".to_owned()).await?;
|
||||
```
|
||||
|
@ -43,7 +43,7 @@ Transactional mode:
|
|||
```rust
|
||||
use tikv_client::TransactionClient;
|
||||
|
||||
let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"], None).await?;
|
||||
let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"]).await?;
|
||||
let mut txn = txn_client.begin_optimistic().await?;
|
||||
txn.put("key".to_owned(), "value".to_owned()).await?;
|
||||
let value = txn.get("key".to_owned()).await?;
|
||||
|
|
Loading…
Reference in New Issue