|
32 | 32 |
|
33 | 33 | Pull requests are always welcome. See [Contributing][__link0] and [Code of Conduct][__link1]. For a list of past changes, see [CHANGELOG.md][__link2].
|
34 | 34 |
|
35 |
| - |
36 | 35 | ### Currently Supported Features
|
37 | 36 |
|
38 |
| - - Reading and writing to InfluxDB |
39 |
| - - Optional Serde support for deserialization |
40 |
| - - Running multiple queries in one request (e.g. `SELECT * FROM weather_berlin; SELECT * FROM weather_london`) |
41 |
| - - Writing single or multiple measurements in one request (e.g. `WriteQuery` or `Vec<WriteQuery>` argument) |
42 |
| - - Authenticated and unauthenticated connections |
43 |
| - - `async`/`await` support |
44 |
| - - `#[derive(InfluxDbWriteable)]` derive macro for writing / reading into structs |
45 |
| - - `GROUP BY` support |
46 |
| - - Tokio and async-std support (see example below) or [available backends][__link3] |
47 |
| - - Swappable HTTP backends ([see below](#Choice-of-HTTP-backend)) |
48 |
| - |
| 37 | +* Reading and writing to InfluxDB |
| 38 | +* Optional Serde support for deserialization |
| 39 | +* Running multiple queries in one request (e.g. `SELECT * FROM weather_berlin; SELECT * FROM weather_london`) |
| 40 | +* Writing single or multiple measurements in one request (e.g. `WriteQuery` or `Vec<WriteQuery>` argument) |
| 41 | +* Authenticated and unauthenticated connections |
| 42 | +* `async`/`await` support |
| 43 | +* `#[derive(InfluxDbWriteable)]` derive macro for writing / reading into structs |
| 44 | +* `GROUP BY` support |
| 45 | +* Tokio and async-std support (see example below) or [available backends][__link3] |
| 46 | +* Swappable HTTP backends ([see below](#Choice-of-HTTP-backend)) |
49 | 47 |
|
50 | 48 | ## Quickstart
|
51 | 49 |
|
52 | 50 | Add the following to your `Cargo.toml`
|
53 | 51 |
|
54 |
| - |
55 | 52 | ```toml
|
56 | 53 | influxdb = { version = "0.7.2", features = ["derive"] }
|
57 | 54 | ```
|
58 | 55 |
|
59 | 56 | For an example with using Serde deserialization, please refer to [serde_integration][__link4]
|
60 | 57 |
|
61 |
| - |
62 | 58 | ```rust
|
63 | 59 | use chrono::{DateTime, Utc};
|
64 | 60 | use influxdb::{Client, Error, InfluxDbWriteable, ReadQuery, Timestamp};
|
65 | 61 |
|
66 | 62 | #[tokio::main]
|
67 |
| -// or #[async_std::main] if you prefer |
68 | 63 | async fn main() -> Result<(), Error> {
|
69 | 64 | // Connect to db `test` on `http://localhost:8086`
|
70 | 65 | let client = Client::new("http://localhost:8086", "test");
|
@@ -104,76 +99,65 @@ async fn main() -> Result<(), Error> {
|
104 | 99 | }
|
105 | 100 | ```
|
106 | 101 |
|
107 |
| -For further examples, check out the integration tests in `tests/integration_tests.rs` in the repository. |
108 |
| - |
| 102 | +For further examples, check out the integration tests in `tests/integration_tests.rs` |
| 103 | +in the repository. |
109 | 104 |
|
110 | 105 | ## Choice of HTTP backend
|
111 | 106 |
|
112 | 107 | To communicate with InfluxDB, you can choose the HTTP backend to be used configuring the appropriate feature. We recommend sticking with the default reqwest-based client, unless you really need async-std compatibility.
|
113 | 108 |
|
114 |
| - - **[hyper][__link5]** (through reqwest, used by default), with [rustls][__link6] |
115 |
| - ```toml |
116 |
| - influxdb = { version = "0.7.2", features = ["derive"] } |
117 |
| - ``` |
118 |
| - |
119 |
| - |
120 |
| - - **[hyper][__link7]** (through reqwest), with native TLS (OpenSSL) |
121 |
| - ```toml |
122 |
| - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls"] } |
123 |
| - ``` |
124 |
| - |
125 |
| - |
126 |
| - - **[hyper][__link8]** (through reqwest), with vendored native TLS (OpenSSL) |
127 |
| - ```toml |
128 |
| - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls-vendored"] } |
129 |
| - ``` |
130 |
| - |
131 |
| - |
132 |
| - - **[curl][__link9]**, using [libcurl][__link10] |
133 |
| - ```toml |
134 |
| - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "curl-client"] } |
135 |
| - ``` |
136 |
| - |
137 |
| - |
138 |
| - - **[async-h1][__link11]** with native TLS (OpenSSL) |
139 |
| - ```toml |
140 |
| - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client"] } |
141 |
| - ``` |
142 |
| - |
143 |
| - |
144 |
| - - **[async-h1][__link12]** with [rustls][__link13] |
145 |
| - ```toml |
146 |
| - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client-rustls"] } |
147 |
| - ``` |
148 |
| - |
149 |
| - |
150 |
| - - WebAssembly’s `window.fetch`, via `web-sys` and **[wasm-bindgen][__link14]** |
151 |
| - ```toml |
152 |
| - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "wasm-client"] } |
153 |
| - ``` |
154 |
| - |
155 |
| - |
156 |
| - |
| 109 | +* **[hyper][__link5]** (through reqwest, used by default), with [rustls][__link6] |
| 110 | + ```toml |
| 111 | + influxdb = { version = "0.7.2", features = ["derive"] } |
| 112 | + ``` |
| 113 | + |
| 114 | +* **[hyper][__link7]** (through reqwest), with native TLS (OpenSSL) |
| 115 | + ```toml |
| 116 | + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls"] } |
| 117 | + ``` |
| 118 | + |
| 119 | +* **[hyper][__link8]** (through reqwest), with vendored native TLS (OpenSSL) |
| 120 | + ```toml |
| 121 | + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls-vendored"] } |
| 122 | + ``` |
| 123 | + |
| 124 | +* **[curl][__link9]**, using [libcurl][__link10] |
| 125 | + ```toml |
| 126 | + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "curl-client"] } |
| 127 | + ``` |
| 128 | + |
| 129 | +* **[async-h1][__link11]** with native TLS (OpenSSL) |
| 130 | + ```toml |
| 131 | + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client"] } |
| 132 | + ``` |
| 133 | + |
| 134 | +* **[async-h1][__link12]** with [rustls][__link13] |
| 135 | + ```toml |
| 136 | + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client-rustls"] } |
| 137 | + ``` |
| 138 | + |
| 139 | +* WebAssembly’s `window.fetch`, via `web-sys` and **[wasm-bindgen][__link14]** |
| 140 | + ```toml |
| 141 | + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "wasm-client"] } |
| 142 | + ``` |
157 | 143 |
|
158 | 144 | ## License
|
159 | 145 |
|
160 |
| -[![License: MIT][__link15]][__link16] |
161 |
| - |
| 146 | +[][__link15] |
162 | 147 |
|
163 | 148 |
|
164 | 149 | @ 2020-2024 Gero Gerke, msrd0 and [contributors].
|
165 | 150 |
|
166 | 151 | [contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors
|
167 |
| - [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGzJ_QpW55zB1G0S-TER-rIfLG2gXv8EYBG3jG1nuXXn-kdx-YXKEG9BSlXCisRNxGyudsuAyPU_iG753wscIDhrEG2I5swlqlF_MYWSBgmhpbmZsdXhkYmUwLjcuMg |
| 152 | + [__cargo_doc2readme_dependencies_info]: ggGkYW0CYXSEGzJ_QpW55zB1G0S-TER-rIfLG2gXv8EYBG3jG1nuXXn-kdx-YXKEG4NMwSc-atpuGyQ3O7T4Ur42GzFqIg36Zfn7G7roc8ix9SwDYWSBgmhpbmZsdXhkYmUwLjcuMg |
168 | 153 | [__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md
|
169 | 154 | [__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md
|
170 | 155 | [__link10]: https://curl.se/libcurl/
|
171 | 156 | [__link11]: https://github.com/http-rs/async-h1
|
172 | 157 | [__link12]: https://github.com/http-rs/async-h1
|
173 | 158 | [__link13]: https://github.com/ctz/rustls
|
174 | 159 | [__link14]: https://github.com/rustwasm/wasm-bindgen
|
175 |
| - [__link15]: https://img.shields.io/badge/License-MIT-yellow.svg |
176 |
| - [__link16]: https://opensource.org/licenses/MIT |
| 160 | + [__link15]: https://opensource.org/licenses/MIT |
177 | 161 | [__link2]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CHANGELOG.md
|
178 | 162 | [__link3]: https://github.com/influxdb-rs/influxdb-rust/blob/main/influxdb/Cargo.toml
|
179 | 163 | [__link4]: https://docs.rs/influxdb/0.7.2/influxdb/?search=integrations::serde_integration
|
|
0 commit comments