Before TiKV Rust Client is officially released, it is not recommended to be used in a production environment.
This guide introduces how to interact with TiKV using .
The minimum supported version of Rust is 1.40. The minimum supported version of TiKV is 5.0.0.
Value
: Refers to a value in the store, which is an alias ofVec<u8>
.BoundRange
: Used for range related requests likescan
. It implementsFrom
for Rust ranges so you can pass a Rust range of keys to the request. For example:client.delete_range(vec![]..)
.
Before you start, you need to add the as a dependency in the Cargo.toml
file of your project.
With a connected tikv_client::RawClient
, you can perform actions such as put
, get
, delete
, and scan
:
These functions also have batch variants (batch_put
, batch_get
, batch_delete
and batch_scan
), which help to considerably reduce network overhead and greatly improve performance under certain workloads.
With a connected tikv_client::TransactionClient
, you can begin a transaction:
Then you can send commands such as get
, set
, delete
, and scan
:
You can commit these changes when you are ready, or roll back if you prefer to abort the operation:
You can find all the functions that TransactionClient
supports in the Transactional requests table.