|
1 |
| -# TiKV Client (Rust) |
2 |
| - |
3 |
| -[](https://travis-ci.org/tikv/client-rust) |
4 |
| -[](https://docs.rs/tikv-client/) |
5 |
| - |
6 |
| -> Currently this crate is experimental and some portions (e.g. the Transactional API) are still in active development. You're encouraged to use this library for testing and to help us find problems! |
7 |
| -
|
8 |
| -This crate provides a clean, ready to use client for [TiKV](https://github.com/tikv/tikv), a |
9 |
| -distributed transactional Key-Value database written in Rust. |
10 |
| - |
11 |
| -With this crate you can easily connect to any TiKV deployment, interact with it, and mutate the data it contains. |
12 |
| - |
13 |
| -This is an open source (Apache 2) project hosted by the Cloud Native Computing Foundation (CNCF) and maintained by the TiKV Authors. *We'd love it if you joined us in improving this project.* |
14 |
| - |
15 |
| -## Using the client |
16 |
| - |
17 |
| -The TiKV client is a Rust library (crate). It requires version 1.36 of the compiler and standard libraries (which will be stable from the 4th July 2019, see below for ensuring compatibility). |
18 |
| - |
19 |
| -To use this crate in your project, add it as a dependency in your `Cargo.toml`: |
20 |
| - |
21 |
| -```toml |
22 |
| -[dependencies] |
23 |
| -# ...Your other dependencies... |
24 |
| -tikv-client = { git = "https://github.com/tikv/client-rust.git" } |
25 |
| -``` |
26 |
| - |
27 |
| -The client requires a Git dependency until we can [publish it](https://github.com/tikv/client-rust/issues/32). |
28 |
| - |
29 |
| -There are [examples](examples) which show how to use the client in a Rust program. |
30 |
| - |
31 |
| -The examples and documentation use async/await syntax. This is a new feature in Rust and is currently unstable. To use async/await you'll need to add the feature flag `#![async_await]` to your crate and use a nightly compiler (see below). |
32 |
| - |
33 |
| -## Access the documentation |
34 |
| - |
35 |
| -We recommend using the cargo-generated documentation to browse and understand the API. We've done |
36 |
| -our best to include ample, tested, and understandable examples. |
37 |
| - |
38 |
| -You can visit [docs.rs/tikv-client](https://docs.rs/tikv-client/), or build the documentation yourself. |
39 |
| - |
40 |
| -You can access the documentation on your machine by running the following in any project that depends on `tikv-client`. |
41 |
| - |
42 |
| -```bash |
43 |
| -cargo doc --package tikv-client --open |
44 |
| -# If it didn't work, browse file URL it tried to open with your browser. |
45 |
| -``` |
46 |
| - |
47 |
| -## Toolchain versions |
48 |
| - |
49 |
| -To check what version of Rust you are using, run |
50 |
| - |
51 |
| -```bash |
52 |
| -rustc --version |
53 |
| -``` |
54 |
| - |
55 |
| -You'll see something like `rustc 1.36.0-nightly (a784a8022 2019-05-09)` where the `1.36.0` is the toolchain version, and `nightly` is the channel (stable/beta/nightly). To install another toolchain use |
56 |
| - |
57 |
| -```bash |
58 |
| -rustup toolchain install nightly |
59 |
| -``` |
60 |
| - |
61 |
| -Where `nightly` here is the channel to add. To update your toolchains, run |
62 |
| - |
63 |
| -```bash |
64 |
| -rustup update |
65 |
| -``` |
66 |
| - |
67 |
| -To build your project using a specified toolchain, use something like |
68 |
| - |
69 |
| -```bash |
70 |
| -cargo +nightly build |
71 |
| -``` |
72 |
| - |
73 |
| -Where `nightly` names the toolchain (by specifying the channel, in this case). |
| 1 | +# TiKV Client (Rust) |
| 2 | + |
| 3 | +[](https://travis-ci.org/pingcap/client-rust) |
| 4 | +[](https://docs.rs/tikv-client/) |
| 5 | + |
| 6 | +> Currently this crate is experimental and some portions (e.g. the Transactional API) are still in active development. You're encouraged to use this library for testing and to help us find problems! |
| 7 | +
|
| 8 | +This crate provides a clean, ready to use client for [TiKV](https://github.com/tikv/tikv), a |
| 9 | +distributed transactional Key-Value database written in Rust. |
| 10 | + |
| 11 | +With this crate you can easily connect to any TiKV deployment, interact with it, and mutate the data it contains. |
| 12 | + |
| 13 | +This is an open source (Apache 2) project hosted by the Cloud Native Computing Foundation (CNCF) and maintained by the TiKV Authors. *We'd love it if you joined us in improving this project.* |
| 14 | + |
| 15 | +## Using the client |
| 16 | + |
| 17 | +The TiKV client is a Rust library (crate). It requires version 1.36 of the compiler and standard libraries (which will be stable from the 4th July 2019, see below for ensuring compatibility). |
| 18 | + |
| 19 | +To use this crate in your project, add it as a dependency in your `Cargo.toml`: |
| 20 | + |
| 21 | +```toml |
| 22 | +[dependencies] |
| 23 | +# ...Your other dependencies... |
| 24 | +tikv-client = { git = "https://github.com/tikv/client-rust.git" } |
| 25 | +``` |
| 26 | + |
| 27 | +The client requires a Git dependency until we can [publish it](https://github.com/tikv/client-rust/issues/32). |
| 28 | + |
| 29 | +There are [examples](examples) which show how to use the client in a Rust program. |
| 30 | + |
| 31 | +The examples and documentation use async/await syntax. This is a new feature in Rust and is currently unstable. To use async/await you'll need to add the feature flag `#![async_await]` to your crate and use a nightly compiler (see below). |
| 32 | + |
| 33 | +## Access the documentation |
| 34 | + |
| 35 | +We recommend using the cargo-generated documentation to browse and understand the API. We've done |
| 36 | +our best to include ample, tested, and understandable examples. |
| 37 | + |
| 38 | +You can visit [docs.rs/tikv-client](https://docs.rs/tikv-client/), or build the documentation yourself. |
| 39 | + |
| 40 | +You can access the documentation on your machine by running the following in any project that depends on `tikv-client`. |
| 41 | + |
| 42 | +```bash |
| 43 | +cargo doc --package tikv-client --open |
| 44 | +# If it didn't work, browse file URL it tried to open with your browser. |
| 45 | +``` |
| 46 | + |
| 47 | +## Running benchmarks |
| 48 | + |
| 49 | +This crate uses [`criterion`](https://github.com/bheisler/criterion.rs) for benchmarking. Most benchmarks use [`proptest`](https://github.com/altsysrq/proptest) to generate values for bench runs. |
| 50 | + |
| 51 | +Currently, all of the benchmarks are gated by the `integration-tests` feature, and require a functioning TiKV (and PD) cluster. |
| 52 | + |
| 53 | +```bash |
| 54 | +export PD_ADDRS=192.168.0.100:2379,192.168.0.101:2379,192.168.0.102:2379 |
| 55 | +cargo +nightly bench --features integration-tests |
| 56 | +``` |
| 57 | + |
| 58 | +It is possible to limit the scope of benchmarks: |
| 59 | + |
| 60 | +```bash |
| 61 | +export PD_ADDRS=192.168.0.100:2379,192.168.0.101:2379,192.168.0.102:2379 |
| 62 | +cargo +nightly bench --features integration-tests raw |
| 63 | +``` |
| 64 | + |
| 65 | +## Toolchain versions |
| 66 | + |
| 67 | +To check what version of Rust you are using, run |
| 68 | + |
| 69 | +```bash |
| 70 | +rustc --version |
| 71 | +``` |
| 72 | + |
| 73 | +You'll see something like `rustc 1.36.0-nightly (a784a8022 2019-05-09)` where the `1.36.0` is the toolchain version, and `nightly` is the channel (stable/beta/nightly). To install another toolchain use |
| 74 | + |
| 75 | +```bash |
| 76 | +rustup toolchain install nightly |
| 77 | +``` |
| 78 | + |
| 79 | +Where `nightly` here is the channel to add. To update your toolchains, run |
| 80 | + |
| 81 | +```bash |
| 82 | +rustup update |
| 83 | +``` |
| 84 | + |
| 85 | +To build your project using a specified toolchain, use something like |
| 86 | + |
| 87 | +```bash |
| 88 | +cargo +nightly build |
| 89 | +``` |
| 90 | + |
| 91 | +Where `nightly` names the toolchain (by specifying the channel, in this case). |
0 commit comments