Skip to content

Commit 097614d

Browse files
committed
remove some more stuff
1 parent aa69c36 commit 097614d

File tree

7 files changed

+69
-107
lines changed

7 files changed

+69
-107
lines changed

.github/workflows/rust.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ jobs:
122122
toolchain: stable
123123
nightly: false
124124
http-backend:
125-
- curl-client
126-
- h1-client
127-
- h1-client-rustls
128-
- hyper-client
129125
- reqwest-client-rustls
130126
- reqwest-client-native-tls
131127
- reqwest-client-native-tls-vendored

README.md

Lines changed: 49 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -32,39 +32,34 @@
3232

3333
Pull requests are always welcome. See [Contributing][__link0] and [Code of Conduct][__link1]. For a list of past changes, see [CHANGELOG.md][__link2].
3434

35-
3635
### Currently Supported Features
3736

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))
4947

5048
## Quickstart
5149

5250
Add the following to your `Cargo.toml`
5351

54-
5552
```toml
5653
influxdb = { version = "0.7.2", features = ["derive"] }
5754
```
5855

5956
For an example with using Serde deserialization, please refer to [serde_integration][__link4]
6057

61-
6258
```rust
6359
use chrono::{DateTime, Utc};
6460
use influxdb::{Client, Error, InfluxDbWriteable, ReadQuery, Timestamp};
6561

6662
#[tokio::main]
67-
// or #[async_std::main] if you prefer
6863
async fn main() -> Result<(), Error> {
6964
// Connect to db `test` on `http://localhost:8086`
7065
let client = Client::new("http://localhost:8086", "test");
@@ -104,76 +99,65 @@ async fn main() -> Result<(), Error> {
10499
}
105100
```
106101

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.
109104

110105
## Choice of HTTP backend
111106

112107
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.
113108

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+
```
157143

158144
## License
159145

160-
[![License: MIT][__link15]][__link16]
161-
146+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)][__link15]
162147

163148

164149
@ 2020-2024 Gero Gerke, msrd0 and [contributors].
165150

166151
[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
168153
[__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md
169154
[__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md
170155
[__link10]: https://curl.se/libcurl/
171156
[__link11]: https://github.com/http-rs/async-h1
172157
[__link12]: https://github.com/http-rs/async-h1
173158
[__link13]: https://github.com/ctz/rustls
174159
[__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
177161
[__link2]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CHANGELOG.md
178162
[__link3]: https://github.com/influxdb-rs/influxdb-rust/blob/main/influxdb/Cargo.toml
179163
[__link4]: https://docs.rs/influxdb/0.7.2/influxdb/?search=integrations::serde_integration

influxdb/src/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl Client {
194194
/// use influxdb::InfluxDbWriteable;
195195
/// use std::time::{SystemTime, UNIX_EPOCH};
196196
///
197-
/// # #[async_std::main]
197+
/// # #[tokio::main]
198198
/// # async fn main() -> Result<(), influxdb::Error> {
199199
/// let start = SystemTime::now();
200200
/// let since_the_epoch = start

influxdb/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
//! use influxdb::{Client, Error, InfluxDbWriteable, ReadQuery, Timestamp};
2727
//!
2828
//! #[tokio::main]
29-
//! // or #[async_std::main] if you prefer
3029
//! async fn main() -> Result<(), Error> {
3130
//! // Connect to db `test` on `http://localhost:8086`
3231
//! let client = Client::new("http://localhost:8086", "test");

influxdb/tests/derive_integration_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn test_build_query() {
5151
/// INTEGRATION TEST
5252
///
5353
/// This integration tests that writing data and retrieving the data again is working
54-
#[async_std::test]
54+
#[tokio::test]
5555
#[cfg(not(tarpaulin_include))]
5656
async fn test_derive_simple_write() {
5757
const TEST_NAME: &str = "test_derive_simple_write";
@@ -82,7 +82,7 @@ async fn test_derive_simple_write() {
8282
/// This integration tests that writing data and retrieving the data again is working
8383
#[cfg(feature = "derive")]
8484
#[cfg(feature = "serde")]
85-
#[async_std::test]
85+
#[tokio::test]
8686
#[cfg(not(tarpaulin_include))]
8787
async fn test_write_and_read_option() {
8888
const TEST_NAME: &str = "test_write_and_read_option";

influxdb/tests/integration_tests.rs

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,11 @@ use utilities::{
1111
use influxdb::InfluxDbWriteable;
1212
use influxdb::{Client, Error, ReadQuery, Timestamp};
1313

14-
/// INTEGRATION TEST
15-
///
16-
/// This test case tests whether the InfluxDB server can be connected to and gathers info about it - tested with async_std
17-
#[async_std::test]
18-
#[cfg(not(tarpaulin_include))]
19-
async fn test_ping_influx_db_async_std() {
20-
let client = create_client("notusedhere");
21-
let result = client.ping().await;
22-
assert_result_ok(&result);
23-
24-
let (build, version) = result.unwrap();
25-
assert!(!build.is_empty(), "Build should not be empty");
26-
assert!(!version.is_empty(), "Build should not be empty");
27-
28-
println!("build: {build} version: {version}");
29-
}
30-
3114
/// INTEGRATION TEST
3215
///
3316
/// This test case tests whether the InfluxDB server can be connected to and gathers info about it - tested with tokio 1.0
3417
#[tokio::test]
35-
#[cfg(not(any(tarpaulin_include, feature = "hyper-client")))]
18+
#[cfg(not(any(tarpaulin_include)))]
3619
async fn test_ping_influx_db_tokio() {
3720
let client = create_client("notusedhere");
3821
let result = client.ping().await;
@@ -48,7 +31,7 @@ async fn test_ping_influx_db_tokio() {
4831
/// INTEGRATION TEST
4932
///
5033
/// This test case tests connection error
51-
#[async_std::test]
34+
#[tokio::test]
5235
#[cfg(not(tarpaulin_include))]
5336
async fn test_connection_error() {
5437
let test_name = "test_connection_error";
@@ -69,7 +52,7 @@ async fn test_connection_error() {
6952
/// INTEGRATION TEST
7053
///
7154
/// This test case tests the Authentication
72-
#[async_std::test]
55+
#[tokio::test]
7356
#[cfg(not(tarpaulin_include))]
7457
async fn test_authed_write_and_read() {
7558
const TEST_NAME: &str = "test_authed_write_and_read";
@@ -117,7 +100,7 @@ async fn test_authed_write_and_read() {
117100
/// INTEGRATION TEST
118101
///
119102
/// This test case tests the Authentication
120-
#[async_std::test]
103+
#[tokio::test]
121104
#[cfg(not(tarpaulin_include))]
122105
async fn test_wrong_authed_write_and_read() {
123106
use http::StatusCode;
@@ -189,7 +172,7 @@ async fn test_wrong_authed_write_and_read() {
189172
/// INTEGRATION TEST
190173
///
191174
/// This test case tests the Authentication
192-
#[async_std::test]
175+
#[tokio::test]
193176
#[cfg(not(tarpaulin_include))]
194177
async fn test_non_authed_write_and_read() {
195178
use http::StatusCode;
@@ -247,7 +230,7 @@ async fn test_non_authed_write_and_read() {
247230
/// INTEGRATION TEST
248231
///
249232
/// This integration tests that writing data and retrieving the data again is working
250-
#[async_std::test]
233+
#[tokio::test]
251234
#[cfg(not(tarpaulin_include))]
252235
async fn test_write_and_read_field() {
253236
const TEST_NAME: &str = "test_write_field";
@@ -280,7 +263,7 @@ async fn test_write_and_read_field() {
280263
/// INTEGRATION TEST
281264
///
282265
/// This test case tests the authentication on json reads
283-
#[async_std::test]
266+
#[tokio::test]
284267
#[cfg(feature = "serde")]
285268
#[cfg(not(tarpaulin_include))]
286269
async fn test_json_non_authed_read() {
@@ -327,7 +310,7 @@ async fn test_json_non_authed_read() {
327310
/// INTEGRATION TEST
328311
///
329312
/// This test case tests the authentication on json reads
330-
#[async_std::test]
313+
#[tokio::test]
331314
#[cfg(feature = "serde")]
332315
#[cfg(not(tarpaulin_include))]
333316
async fn test_json_authed_read() {
@@ -364,7 +347,7 @@ async fn test_json_authed_read() {
364347
/// INTEGRATION TEST
365348
///
366349
/// This integration tests that writing data and retrieving the data again is working
367-
#[async_std::test]
350+
#[tokio::test]
368351
#[cfg(feature = "serde")]
369352
#[cfg(not(tarpaulin_include))]
370353
async fn test_write_and_read_option() {
@@ -423,7 +406,7 @@ async fn test_write_and_read_option() {
423406
///
424407
/// This test case tests whether JSON can be decoded from a InfluxDB response and whether that JSON
425408
/// is equal to the data which was written to the database
426-
#[async_std::test]
409+
#[tokio::test]
427410
#[cfg(feature = "serde")]
428411
#[cfg(not(tarpaulin_include))]
429412
async fn test_json_query() {
@@ -473,7 +456,7 @@ async fn test_json_query() {
473456
///
474457
/// This test case tests whether the response to a GROUP BY can be parsed by
475458
/// deserialize_next_tagged into a tags struct
476-
#[async_std::test]
459+
#[tokio::test]
477460
#[cfg(feature = "serde")]
478461
#[cfg(not(tarpaulin_include))]
479462
async fn test_json_query_tagged() {
@@ -539,7 +522,7 @@ async fn test_json_query_tagged() {
539522
#[tokio::test]
540523
#[cfg(all(
541524
feature = "serde",
542-
not(any(tarpaulin_include, feature = "hyper-client"))
525+
not(any(tarpaulin_include))
543526
))]
544527
async fn test_json_query_vec() {
545528
const TEST_NAME: &str = "test_json_query_vec";
@@ -587,7 +570,7 @@ async fn test_json_query_vec() {
587570
/// INTEGRATION TEST
588571
///
589572
/// This integration test tests whether using the wrong query method fails building the query
590-
#[async_std::test]
573+
#[tokio::test]
591574
#[cfg(feature = "serde")]
592575
#[cfg(not(tarpaulin_include))]
593576
async fn test_serde_multi_query() {
@@ -661,7 +644,7 @@ async fn test_serde_multi_query() {
661644
/// INTEGRATION TEST
662645
///
663646
/// This integration test tests whether using the wrong query method fails building the query
664-
#[async_std::test]
647+
#[tokio::test]
665648
#[cfg(feature = "serde")]
666649
#[cfg(not(tarpaulin_include))]
667650
async fn test_wrong_query_errors() {

influxdb/tests/integration_tests_v2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use influxdb::{Client, Error, ReadQuery, Timestamp};
1010
/// INTEGRATION TEST
1111
///
1212
/// This test case tests the Authentication
13-
#[async_std::test]
13+
#[tokio::test]
1414
#[cfg(not(tarpaulin))]
1515
async fn test_authed_write_and_read() {
1616
run_test(
@@ -44,7 +44,7 @@ async fn test_authed_write_and_read() {
4444
/// INTEGRATION TEST
4545
///
4646
/// This test case tests the Authentication
47-
#[async_std::test]
47+
#[tokio::test]
4848
#[cfg(not(tarpaulin))]
4949
async fn test_wrong_authed_write_and_read() {
5050
use http::StatusCode;
@@ -84,7 +84,7 @@ async fn test_wrong_authed_write_and_read() {
8484
/// INTEGRATION TEST
8585
///
8686
/// This test case tests the Authentication
87-
#[async_std::test]
87+
#[tokio::test]
8888
#[cfg(not(tarpaulin))]
8989
async fn test_non_authed_write_and_read() {
9090
use http::StatusCode;

0 commit comments

Comments
 (0)