Skip to content

Commit ecce6ae

Browse files
authored
Merge branch 'main' into time
2 parents 945867d + 4bb0580 commit ecce6ae

22 files changed

+249
-194
lines changed

.github/workflows/rust.yml

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
name: README Format Check
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
16-
- uses: docker://ghcr.io/msrd0/cargo-doc2readme:nightly
15+
- uses: actions/checkout@v5
16+
- uses: docker://codeberg.org/msrd0/cargo-doc2readme:nightly
1717
with:
1818
entrypoint: cargo
1919
args: doc2readme -p influxdb --expand-macros --check
@@ -23,10 +23,12 @@ jobs:
2323
name: Style Check (clippy)
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v4
27-
- uses: dtolnay/rust-toolchain@1.75.0
26+
- uses: actions/checkout@v5
27+
- uses: dtolnay/rust-toolchain@1.88.0
2828
with:
2929
components: clippy
30+
- name: Update Cargo.lock
31+
run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update
3032
- name: Check Clippy lints (reqwest)
3133
run: cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features chrono,time,serde,derive,reqwest-client-rustls -- -D warnings
3234
- name: Check Clippy lints (surf)
@@ -37,7 +39,7 @@ jobs:
3739
name: Style Checks (rustfmt)
3840
runs-on: ubuntu-latest
3941
steps:
40-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
4143
- uses: dtolnay/rust-toolchain@nightly
4244
with:
4345
components: rustfmt
@@ -53,9 +55,6 @@ jobs:
5355
fail-fast: false
5456
matrix:
5557
rust:
56-
- name: MSRV
57-
toolchain: "1.65"
58-
nightly: false
5958
- name: Stable
6059
toolchain: stable
6160
nightly: false
@@ -66,21 +65,51 @@ jobs:
6665
toolchain: nightly
6766
nightly: true
6867
os: [ubuntu-latest, windows-latest, macOS-latest]
68+
include:
69+
- rust:
70+
name: MSRV
71+
toolchain: stable
72+
nightly: false
73+
os: ubuntu-latest
6974
steps:
70-
- uses: actions/checkout@v4
75+
- uses: actions/checkout@v5
7176
- uses: dtolnay/rust-toolchain@master
7277
with:
7378
toolchain: ${{matrix.rust.toolchain}}
7479
id: rust-toolchain
80+
- run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update
81+
# on msrv runs, downgrade rust after generating the Cargo.lock file
82+
- run: sudo apt -y update && sudo apt -y install --no-install-recommends yq
83+
if: matrix.rust.name == 'MSRV'
84+
- run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT
85+
id: msrv
86+
if: matrix.rust.name == 'MSRV'
87+
- uses: dtolnay/rust-toolchain@master
88+
with:
89+
toolchain: ${{steps.msrv.outputs.rust-version}}
90+
id: msrv-toolchain
91+
if: matrix.rust.name == 'MSRV'
92+
# on non-msrv runs, use one cache key ...
7593
- uses: actions/cache@v4
7694
with:
7795
path: |
7896
~/.cargo/git
7997
~/.cargo/registry
8098
target
8199
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
82-
- run: cargo test --lib
83-
- run: cargo test --doc
100+
if: matrix.rust.name != 'MSRV'
101+
# ... and on msrv runs, use another
102+
- uses: actions/cache@v4
103+
with:
104+
path: |
105+
~/.cargo/git
106+
~/.cargo/registry
107+
target
108+
key: "${{runner.os}} Rust ${{steps.msrv-toolchain.outputs.cachekey}}"
109+
if: matrix.rust.name == 'MSRV'
110+
# finally we can run tests
111+
- run: cargo test --lib --locked
112+
- run: cargo test --doc --locked
84113

85114
# this tests that all integration tests are successful
86115
integration_tests:
@@ -129,7 +158,7 @@ jobs:
129158
DOCKER_INFLUXDB_INIT_BUCKET: mydb
130159
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: admintoken
131160
steps:
132-
- uses: actions/checkout@v4
161+
- uses: actions/checkout@v5
133162
- uses: dtolnay/rust-toolchain@master
134163
with:
135164
toolchain: ${{matrix.rust.toolchain}}
@@ -169,7 +198,7 @@ jobs:
169198
INFLUXDB_USER_PASSWORD: password
170199

171200
steps:
172-
- uses: actions/checkout@v4
201+
- uses: actions/checkout@v5
173202
- uses: dtolnay/rust-toolchain@stable
174203
id: rust-toolchain
175204
- name: Get Tarpaulin Version
@@ -214,10 +243,10 @@ jobs:
214243
- coverage
215244
if: github.ref == 'refs/heads/main'
216245
steps:
217-
- uses: actions/checkout@v4
246+
- uses: actions/checkout@v5
218247
with:
219248
ref: gh-pages
220-
- uses: actions/download-artifact@v4
249+
- uses: actions/download-artifact@v5
221250
with:
222251
name: tarpaulin-report
223252
- run: |

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7272

7373
- Batch write support ([@sunng87](https://github.com/sunng87) in [#87](https://github.com/influxdb-rs/influxdb-rust/pull/87))
7474

75-
Build a query containing mutliple rows to be inserted
75+
Build a query containing multiple rows to be inserted
7676
```
7777
let q0 = Timestamp::Hours(11)
7878
.into_query("weather")

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Please open an issue if you have suggestions for new labels.
139139
| Issue label | List issues | Description |
140140
| -------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
141141
| `Type: Bug` | [search](https://github.com/influxdb-rs/influxdb-rust/labels/Status%3A%20Type%20Bug) | Applied to issues reporting bugs. |
142-
| `Type: Chore` | [search](https://github.com/influxdb-rs/influxdb-rust/labels/Status%3A%20Type%20Chore) | Applied to issues and pull requests regarding miscellaneous tasks around the reposity. |
142+
| `Type: Chore` | [search](https://github.com/influxdb-rs/influxdb-rust/labels/Status%3A%20Type%20Chore) | Applied to issues and pull requests regarding miscellaneous tasks around the repository. |
143143
| `Type: Enhancement` | [search](https://github.com/influxdb-rs/influxdb-rust/labels/Status%3A%20Type%20Enhancement) | Applied to issues and pull requests where an existing feature is improved. |
144144
| `Type: Governance` | [search](https://github.com/influxdb-rs/influxdb-rust/labels/Status%3A%20Type%20Governance) | Applied to issues pull requests regarding repository governance. |
145145
| `Type: New Feature` | [search](https://github.com/influxdb-rs/influxdb-rust/labels/status%3a%20Type%20New%20Feature) | Applied to issues and pull requests requesting or implementing new features. | |

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
[workspace]
44
members = ["influxdb", "influxdb_derive", "benches"]
5+
resolver = "2"
6+
7+
[workspace.package]
8+
authors = ["Gero Gerke <[email protected]>", "Dominic <[email protected]>"]
9+
edition = "2018"
10+
rust-version = "1.65"
11+
license = "MIT"
12+
repository = "https://github.com/influxdb-rs/influxdb-rust"
13+
14+
[workspace.lints.rust]
15+
bare_trait_objects = "forbid"
16+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin)', 'cfg(tarpaulin_include)'] }
17+
18+
[workspace.lints.clippy]
19+
multiple_bound_locations = "allow" # clippy has wrong opinions
20+
needless_doctest_main = "allow"
21+
needless_lifetimes = "allow" # False positive in client/mod.rs query fn
522

623
[patch.crates-io]
724
influxdb = { path = "./influxdb" }

README.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<a href="https://www.rust-lang.org/en-US/">
2626
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
2727
</a>
28-
<a href="https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html">
29-
<img src="https://img.shields.io/badge/rustc-1.65+-yellow.svg" alt='Minimum Rust Version: 1.65' />
28+
<a href="https://github.com/rust-lang/rust/releases/tag/{{ rust_version | urlencode }}">
29+
<img src="https://img.shields.io/badge/rustc-{{ rust_version | urlencode }}+-yellow.svg" alt='Minimum Rust Version: {{ rust_version }}' />
3030
</a>
3131
</p>
3232

README.md

Lines changed: 56 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,36 @@
2525
<a href="https://www.rust-lang.org/en-US/">
2626
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
2727
</a>
28-
<a href="https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html">
29-
<img src="https://img.shields.io/badge/rustc-1.65+-yellow.svg" alt='Minimum Rust Version: 1.65' />
28+
<a href="https://github.com/rust-lang/rust/releases/tag/1.65.0">
29+
<img src="https://img.shields.io/badge/rustc-1.65.0+-yellow.svg" alt='Minimum Rust Version: 1.65.0' />
3030
</a>
3131
</p>
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};
@@ -104,73 +100,62 @@ async fn main() -> Result<(), Error> {
104100
}
105101
```
106102

107-
For further examples, check out the integration tests in `tests/integration_tests.rs` in the repository.
108-
103+
For further examples, check out the integration tests in `tests/integration_tests.rs`
104+
in the repository.
109105

110106
## Choice of HTTP backend
111107

112108
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.
113109

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-
- **[hyper][__link9]** (through surf), use this if you need tokio 0.2 compatibility
133-
```toml
134-
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "hyper-client"] }
135-
```
136-
137-
138-
- **[curl][__link10]**, using [libcurl][__link11]
139-
```toml
140-
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "curl-client"] }
141-
```
142-
143-
144-
- **[async-h1][__link12]** with native TLS (OpenSSL)
145-
```toml
146-
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client"] }
147-
```
148-
149-
150-
- **[async-h1][__link13]** with [rustls][__link14]
151-
```toml
152-
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client-rustls"] }
153-
```
154-
155-
156-
- WebAssembly’s `window.fetch`, via `web-sys` and **[wasm-bindgen][__link15]**
157-
```toml
158-
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "wasm-client"] }
159-
```
160-
161-
162-
110+
* **[hyper][__link5]** (through reqwest, used by default), with [rustls][__link6]
111+
```toml
112+
influxdb = { version = "0.7.2", features = ["derive"] }
113+
```
114+
115+
* **[hyper][__link7]** (through reqwest), with native TLS (OpenSSL)
116+
```toml
117+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls"] }
118+
```
119+
120+
* **[hyper][__link8]** (through reqwest), with vendored native TLS (OpenSSL)
121+
```toml
122+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls-vendored"] }
123+
```
124+
125+
* **[hyper][__link9]** (through surf), use this if you need tokio 0.2 compatibility
126+
```toml
127+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "hyper-client"] }
128+
```
129+
130+
* **[curl][__link10]**, using [libcurl][__link11]
131+
```toml
132+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "curl-client"] }
133+
```
134+
135+
* **[async-h1][__link12]** with native TLS (OpenSSL)
136+
```toml
137+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client"] }
138+
```
139+
140+
* **[async-h1][__link13]** with [rustls][__link14]
141+
```toml
142+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client-rustls"] }
143+
```
144+
145+
* WebAssembly’s `window.fetch`, via `web-sys` and **[wasm-bindgen][__link15]**
146+
```toml
147+
influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "wasm-client"] }
148+
```
163149

164150
## License
165151

166-
[![License: MIT][__link16]][__link17]
167-
152+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)][__link16]
168153

169154

170155
@ 2020-2024 Gero Gerke, msrd0 and [contributors].
171156

172157
[contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors
173-
[__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG_RDmlyxxvyrG0rwcLBKoYdvG5It9hbWNgjUGzjD8iBYfsFFYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg
158+
[__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGzJ_QpW55zB1G0S-TER-rIfLG2gXv8EYBG3jG1nuXXn-kdx-YXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg
174159
[__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md
175160
[__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md
176161
[__link10]: https://github.com/alexcrichton/curl-rust
@@ -179,8 +164,7 @@ To communicate with InfluxDB, you can choose the HTTP backend to be used configu
179164
[__link13]: https://github.com/http-rs/async-h1
180165
[__link14]: https://github.com/ctz/rustls
181166
[__link15]: https://github.com/rustwasm/wasm-bindgen
182-
[__link16]: https://img.shields.io/badge/License-MIT-yellow.svg
183-
[__link17]: https://opensource.org/licenses/MIT
167+
[__link16]: https://opensource.org/licenses/MIT
184168
[__link2]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CHANGELOG.md
185169
[__link3]: https://github.com/influxdb-rs/influxdb-rust/blob/main/influxdb/Cargo.toml
186170
[__link4]: https://docs.rs/influxdb/0.7.2/influxdb/?search=integrations::serde_integration

RELEASING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# How to release this crate
22

3-
This project consists of two crates which need to be published to crates.io in the correct order. Additonally, there's some steps one's likely to miss when releasing.
3+
This project consists of two crates which need to be published to crates.io in the correct order. Additionally, there's some steps one's likely to miss when releasing.
44

55
## Pre-Release-Checklist
66

77
- [ ] `influxdb/Cargo.toml` and `influxdb-derive/Cargo.toml`: Bumped `influxdb` and `influxdb-derive` versions to new version number?
8-
- [ ] `influxdb/Cargo.toml`: Changed `influxdb` dependecy on `influxdb-derive` to new version number?
8+
- [ ] `influxdb/Cargo.toml`: Changed `influxdb` dependency on `influxdb-derive` to new version number?
99
- [ ] `CHANGELOG.md`: Remove all entries from the unreleased section
1010
- [ ] `CHANGELOG.md`: Add new Section for the new version number with subsections `Added`, `Changed` and `Fixed`.
1111
- [ ] `CHANGELOG.md`: For each commit since the last release commit `Release vX.Y.Z`, added a changelog entry in the correct section linking to the author and PR in this format?

0 commit comments

Comments
 (0)