Skip to content

Commit 54216d6

Browse files
authored
chore!: update and document MSRV, ClickHouse compatibility (#303)
1 parent 8cf3d2e commit 54216d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+182
-158
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
RUSTFLAGS: -Dwarnings
1212
RUSTDOCFLAGS: -Dwarnings
1313
RUST_BACKTRACE: 1
14-
MSRV: 1.79.0
14+
# note: MSRV now tracked in `rust-toolchain.toml`
1515

1616
jobs:
1717
build:
@@ -23,32 +23,6 @@ jobs:
2323
- run: cargo build --all-targets --no-default-features
2424
- run: cargo build --all-targets --all-features
2525

26-
msrv:
27-
runs-on: ubuntu-latest
28-
env:
29-
RUSTFLAGS: "" # remove -Dwarnings
30-
steps:
31-
- uses: actions/checkout@v4
32-
- run: rustup toolchain install ${{ env.MSRV }} --profile minimal
33-
- run: rustup override set ${{ env.MSRV }}
34-
- run: rustup show active-toolchain -v
35-
# URL 2.5.4 -> ICU4X 2.x require rustc 1.82
36-
# See https://github.com/servo/rust-url?tab=readme-ov-file#alternative-unicode-back-ends
37-
# https://github.com/hsivonen/idna_adapter?tab=readme-ov-file#icu4x-as-the-default
38-
- run: cargo update -p idna_adapter --precise 1.2.0
39-
- run: cargo update -p native-tls --precise 0.2.13 # 0.2.14 requires rustc 1.80
40-
- run: cargo update -p litemap --precise 0.7.4 # 0.7.5 requires rustc 1.81
41-
- run: cargo update -p zerofrom --precise 0.1.5 # 0.1.6 requires rustc 1.81
42-
- run: cargo update -p lz4_flex --precise 0.11.3 # 0.11.4 requires rustc 1.81
43-
- run: cargo update -p url --precise 2.5.0 # 2.5.4 requires rustc 1.82
44-
- run: cargo update -p time --precise 0.3.41 # 0.3.43 requires rustc 1.81
45-
- run: cargo update -p time-core --precise 0.1.4 # 0.1.6 requires rustc 1.81
46-
- run: cargo update -p deranged --precise 0.4.0 # 0.5.x requires rustc 1.81
47-
- run: cargo build
48-
- run: cargo build --no-default-features
49-
- run: cargo build --features uuid,time,chrono
50-
- run: cargo build --all-features
51-
5226
rustfmt:
5327
runs-on: ubuntu-latest
5428
steps:

Cargo.toml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,28 @@ name = "clickhouse"
33
version = "0.13.3"
44
description = "Official Rust client for ClickHouse DB"
55
keywords = ["clickhouse", "database", "driver", "tokio", "hyper"]
6-
authors = ["ClickHouse Contributors", "Paul Loyd <pavelko95@gmail.com>"]
7-
repository = "https://github.com/ClickHouse/clickhouse-rs"
8-
homepage = "https://clickhouse.com"
9-
license = "MIT OR Apache-2.0"
106
readme = "README.md"
11-
edition = "2021"
12-
# update `workspace.package.rust-version` below and CI if changed
13-
# TODO: after bumping to v1.80, remove `--precise` in the "msrv" CI job
14-
rust-version = "1.79.0"
7+
authors.workspace = true
8+
homepage.workspace = true
9+
repository.workspace = true
10+
license.workspace = true
11+
edition.workspace = true
12+
rust-version.workspace = true
1513

1614
[workspace]
1715
members = ["derive", "types"]
16+
# `rust-version`-aware dependency resolution;
17+
# applies to all workspace members
18+
resolver = "3"
1819

1920
[workspace.package]
2021
authors = ["ClickHouse Contributors", "Paul Loyd <pavelko95@gmail.com>"]
2122
repository = "https://github.com/ClickHouse/clickhouse-rs"
2223
homepage = "https://clickhouse.com"
23-
edition = "2021"
24+
edition = "2024"
2425
license = "MIT OR Apache-2.0"
25-
rust-version = "1.79.0"
26+
# N.B. be sure to update this in `rust-toolchain.toml` as well
27+
rust-version = "1.89.0"
2628

2729
[lints.rust]
2830
rust_2018_idioms = { level = "warn", priority = -1 }

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,3 +526,25 @@ The crate provides utils for mocking CH server and testing DDL, `SELECT` and `IN
526526
The functionality can be enabled with the `test-util` feature. Use it **only** in dev-dependencies.
527527
528528
See [the example](https://github.com/ClickHouse/clickhouse-rs/tree/main/examples/mock.rs).
529+
530+
## Support Policies
531+
532+
### Minimum Supported Rust Version (MSRV)
533+
534+
This project's MSRV is the second-to-last stable release as of the beginning of the current release cycle (`0.x.0`),
535+
where it will remain until the beginning of the _next_ release cycle (`0.{x+1}.0`).
536+
537+
The MSRV for the `0.14.x` release cycle is `1.89.0`.
538+
539+
This guarantees that `clickhouse-rs` will compile with a Rust version that is at _least_ six weeks old,
540+
which should be plenty of time for it to make it through any packaging system that is being actively kept up to date.
541+
542+
Beware when installing Rust through operating system package managers, as it can often be a year or more
543+
out-of-date. For example, Debian Bookworm (released 10 June 2023) shipped with Rust 1.63.0 (released 11 August 2022).
544+
545+
### ClickHouse Versions
546+
547+
The supported versions of the ClickHouse database server coincide with the versions currently receiving security
548+
updates.
549+
550+
For the list of currently supported versions, see <https://github.com/ClickHouse/ClickHouse/blob/master/SECURITY.md#security-change-log-and-support>.

benches/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ use clickhouse::error::Result;
1515
use futures_util::stream::StreamExt;
1616
use http_body_util::BodyExt;
1717
use hyper::{
18+
Request, Response,
1819
body::{Body, Incoming},
1920
server::conn,
20-
service, Request, Response,
21+
service,
2122
};
2223
use hyper_util::rt::{TokioIo, TokioTimer};
2324
use tokio::{

benches/common_select.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ pub(crate) fn print_results<T: WithAccessType>(
7575
let access_type = T::ACCESS_TYPE;
7676
&format!(" {access_type:>6}")
7777
};
78-
println!("{compression:>8} {validation_mode:>10} {elapsed:>9.3?} {throughput_mbytes_sec:>4.0} MiB/s {received_mbytes:>4.0} MiB{access}");
78+
println!(
79+
"{compression:>8} {validation_mode:>10} {elapsed:>9.3?} {throughput_mbytes_sec:>4.0} MiB/s {received_mbytes:>4.0} MiB{access}"
80+
);
7981
}
8082

8183
pub(crate) async fn fetch_cursor<T: Row>(

benches/mocked_insert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use bytes::Bytes;
2-
use clickhouse::{error::Result, Client, Compression, Row};
2+
use clickhouse::{Client, Compression, Row, error::Result};
33
use clickhouse_types::{Column, DataTypeNode};
4-
use criterion::{criterion_group, criterion_main, Criterion, Throughput};
4+
use criterion::{Criterion, Throughput, criterion_group, criterion_main};
55
use futures_util::stream;
66
use http_body_util::StreamBody;
77
use hyper::body::{Body, Frame};
8-
use hyper::{body::Incoming, Request, Response};
8+
use hyper::{Request, Response, body::Incoming};
99
use serde::Serialize;
1010
use std::convert::Infallible;
1111
use std::hint::black_box;

benches/mocked_select.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use bytes::Bytes;
22
use clickhouse::{
3-
error::{Error, Result},
43
Client, Compression, Row,
4+
error::{Error, Result},
55
};
66
use clickhouse_types::{Column, DataTypeNode};
7-
use criterion::{criterion_group, criterion_main, Criterion, Throughput};
7+
use criterion::{Criterion, Throughput, criterion_group, criterion_main};
88
use futures_util::stream::{self, StreamExt as _};
99
use http_body_util::StreamBody;
1010
use hyper::{
11-
body::{Body, Frame, Incoming},
1211
Request, Response,
12+
body::{Body, Frame, Incoming},
1313
};
1414
use serde::Deserialize;
1515
use std::convert::Infallible;
@@ -56,7 +56,7 @@ async fn serve(
5656
}
5757

5858
fn prepare_chunk() -> Bytes {
59-
use rand::{distr::StandardUniform, rngs::SmallRng, Rng, SeedableRng};
59+
use rand::{Rng, SeedableRng, distr::StandardUniform, rngs::SmallRng};
6060

6161
// Generate random data to avoid _real_ compression.
6262
// TODO: It would be more useful to generate real data.

benches/select_market_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::common_select::{
2-
do_select_bench, print_header, print_results, BenchmarkRow, WithAccessType, WithId,
2+
BenchmarkRow, WithAccessType, WithId, do_select_bench, print_header, print_results,
33
};
44
use clickhouse::{Client, Compression, Row};
55
use serde::{Deserialize, Serialize};

benches/select_numbers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use serde::Deserialize;
22

33
use crate::common_select::{
4-
do_select_bench, print_header, print_results, BenchmarkRow, WithAccessType, WithId,
4+
BenchmarkRow, WithAccessType, WithId, do_select_bench, print_header, print_results,
55
};
66
use clickhouse::{Compression, Row};
77

benches/select_nyc_taxi_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "time")]
22

33
use crate::common_select::{
4-
do_select_bench, print_header, print_results, BenchmarkRow, WithAccessType, WithId,
4+
BenchmarkRow, WithAccessType, WithId, do_select_bench, print_header, print_results,
55
};
66
use clickhouse::{Client, Compression, Row};
77
use serde::Deserialize;

0 commit comments

Comments
 (0)