diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8930181..f9bd52d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -8,7 +8,7 @@ on: branches: ["main"] env: - RUST_TOOLCHAIN: 1.70.0 + RUST_TOOLCHAIN: 1.74.0 EXASOL_VERSION: 7.0.22 NUM_NODES: 2 ETL_TEST_THREADS: 4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 36eaf7e..45eaba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [Unreleased] +## [0.7.4] - 2024-03-15 ### Added - [#25](https://github.com/bobozaur/sqlx-exasol/pull/25): ETL module refactor based on `hyper`. diff --git a/Cargo.toml b/Cargo.toml index 749596d..1c16021 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sqlx-exasol" -version = "0.7.3" +version = "0.7.4" edition = "2021" authors = ["bobozaur"] description = "Exasol driver for the SQLx framework." @@ -39,33 +39,33 @@ etl_native_tls = ["dep:native-tls", "dep:rcgen", "etl"] [dependencies] rand = "0.8.5" -base64 = "0.21.2" -thiserror = "1.0.30" -url = "2.2.2" -rsa = "0.9.2" -async-tungstenite = "0.24.0" -futures-io = "0.3.28" -futures-util = "0.3.28" -futures-core = "0.3.28" -serde_json = { version = "1.0.100", features = ["raw_value"] } -serde = { version = "1.0.169", features = ["derive"] } -pin-project = "1.1.2" -lru = "0.12.0" -sqlx-core = "0.7.3" -sqlx-macros-core = "0.7.3" -tracing = { version = "0.1.37", features = ["log"] } +base64 = "0.22.0" +thiserror = "1.0.58" +url = "2.5.0" +rsa = "0.9.6" +async-tungstenite = "0.25.0" +futures-io = "0.3.30" +futures-util = "0.3.30" +futures-core = "0.3.30" +serde_json = { version = "1.0.114", features = ["raw_value"] } +serde = { version = "1.0.197", features = ["derive"] } +pin-project = "1.1.5" +lru = "0.12.3" +sqlx-core = "0.7.4" +sqlx-macros-core = "0.7.4" +tracing = { version = "0.1.40", features = ["log"] } arrayvec = "0.7.4" -rcgen = { version = "0.12.0", optional = true } +rcgen = { version = "0.12.1", optional = true } tungstenite = "0.21.0" # Feature flagged optional dependencies -uuid = { version = "1.4.1", features = ["serde"], optional = true } -chrono = { version = "0.4.26", features = ["serde"], optional = true } -rust_decimal = { version = "1.30.0", optional = true } +uuid = { version = "1.7.0", features = ["serde"], optional = true } +chrono = { version = "0.4.35", features = ["serde"], optional = true } +rust_decimal = { version = "1.34.3", optional = true } dotenvy = { version = "0.15.7", optional = true } hex = { version = "0.4.3", optional = true } -flate2 = { version = "1.0.22", optional = true } -async-compression = { version = "0.4.1", features = [ +flate2 = { version = "1.0.28", optional = true } +async-compression = { version = "0.4.6", features = [ "futures-io", "gzip", ], optional = true } @@ -73,19 +73,19 @@ rustls = { version = "0.21", default-features = false, features = [ "dangerous_configuration", "tls12", ], optional = true } -native-tls = { version = "0.2.10", optional = true } +native-tls = { version = "0.2.11", optional = true } hyper-util = { version = "0.1", features = ["full"], optional = true } http-body-util = { version = "0.1", optional = true } -hyper = { version = "1.1", features = ["server", "http1"], optional = true } +hyper = { version = "1.2.0", features = ["server", "http1"], optional = true } bytes = { version = "1.5", optional = true } futures-channel = { version = "0.3.30", optional = true } [dev-dependencies] -sqlx = { version = "0.7.3", features = [ +sqlx = { version = "0.7.4", features = [ "runtime-tokio", "tls-native-tls", "migrate", ] } paste = "1.0.14" -anyhow = "1.0.72" -tokio = { version = "1.31.0", features = ["full"] } +anyhow = "1.0.81" +tokio = { version = "1.36.0", features = ["full"] } diff --git a/README.md b/README.md index d1e1fc9..3423dd3 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,15 @@ A database driver for Exasol to be used with the Rust [sqlx](https://github.com/launchbadge/sqlx) framework, based on the Exasol [Websocket API](https://github.com/exasol/websocket-api). Inspired by [Py-Exasol](https://github.com/exasol/pyexasol) and based on the (now archived) [rust-exasol](https://github.com/bobozaur/rust-exasol) sync driver. -**MSRV**: `1.70` +**MSRV**: `1.74` ## Note >The crate's version resembles the `sqlx` version it is based on so that managing dependencies is simpler. > > With that in mind, please favor using a fixed version of `sqlx` and `sqlx-exasol` in `Cargo.toml` to avoid issues, such as: > ```toml -> sqlx = "=0.7.3" -> sqlx-exasol = "=0.7.3" +> sqlx = "=0.7.4" +> sqlx-exasol = "=0.7.4" > ``` diff --git a/src/lib.rs b/src/lib.rs index 06725f1..a30f3f1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ //! A database driver for Exasol to be used with the Rust [sqlx](https://github.com/launchbadge/sqlx) framework. //! -//! **MSRV**: `1.70` +//! **MSRV**: `1.74` //! //! ## Crate Features flags //! * `etl` - enables the usage ETL jobs without TLS encryption. diff --git a/src/types/chrono.rs b/src/types/chrono.rs index 73e77bc..ce097af 100644 --- a/src/types/chrono.rs +++ b/src/types/chrono.rs @@ -180,11 +180,11 @@ impl<'r> Decode<'r, Exasol> for chrono::Duration { let millis: i64 = millis.parse().map_err(Box::new)?; let sign = if days.is_negative() { -1 } else { 1 }; - let duration = chrono::Duration::days(days) - + chrono::Duration::hours(hours * sign) - + chrono::Duration::minutes(minutes * sign) - + chrono::Duration::seconds(seconds * sign) - + chrono::Duration::milliseconds(millis * sign); + let duration = chrono::Duration::try_days(days).ok_or_else(input_err_fn)? + + chrono::Duration::try_hours(hours * sign).ok_or_else(input_err_fn)? + + chrono::Duration::try_minutes(minutes * sign).ok_or_else(input_err_fn)? + + chrono::Duration::try_seconds(seconds * sign).ok_or_else(input_err_fn)? + + chrono::Duration::try_milliseconds(millis * sign).ok_or_else(input_err_fn)?; Ok(duration) } diff --git a/tests/chrono.rs b/tests/chrono.rs index e5ba266..03a1c98 100644 --- a/tests/chrono.rs +++ b/tests/chrono.rs @@ -29,10 +29,10 @@ test_type_valid!(datetime_local_str::"TIMESTAMP WITH LOCAL TIME ZONE"::( test_type_valid!(datetime_local_option>>::"TIMESTAMP WITH LOCAL TIME ZONE"::("NULL" => None::>, "''" => None::>, "'2023-08-12 19:22:36.591000'" => Some(NaiveDateTime::parse_from_str("2023-08-12 19:22:36.591000", TIMESTAMP_FMT).unwrap().and_local_timezone(Local).unwrap()))); test_type_array!(datetime_local_array>::"TIMESTAMP WITH LOCAL TIME ZONE"::(vec!["2023-08-12 19:22:36.591000", "2023-08-12 19:22:36.591000", "2023-08-12 19:22:36.591000"])); -test_type_valid!(duration::"INTERVAL DAY TO SECOND"::("'10 20:45:50.123'" => Duration::milliseconds(938750123), "'-10 20:45:50.123'" => Duration::milliseconds(-938750123))); +test_type_valid!(duration::"INTERVAL DAY TO SECOND"::("'10 20:45:50.123'" => Duration::try_milliseconds(938750123).unwrap(), "'-10 20:45:50.123'" => Duration::try_milliseconds(-938750123).unwrap())); test_type_valid!(duration_str::"INTERVAL DAY TO SECOND"::("'10 20:45:50.123'" => "+10 20:45:50.123")); -test_type_valid!(duration_with_prec::"INTERVAL DAY(4) TO SECOND"::("'10 20:45:50.123'" => Duration::milliseconds(938750123), "'-10 20:45:50.123'" => Duration::milliseconds(-938750123))); -test_type_valid!(duration_option>::"INTERVAL DAY TO SECOND"::("NULL" => None::, "''" => None::, "'10 20:45:50.123'" => Some(Duration::milliseconds(938750123)))); +test_type_valid!(duration_with_prec::"INTERVAL DAY(4) TO SECOND"::("'10 20:45:50.123'" => Duration::try_milliseconds(938750123).unwrap(), "'-10 20:45:50.123'" => Duration::try_milliseconds(-938750123).unwrap())); +test_type_valid!(duration_option>::"INTERVAL DAY TO SECOND"::("NULL" => None::, "''" => None::, "'10 20:45:50.123'" => Some(Duration::try_milliseconds(938750123).unwrap()))); test_type_array!(duration_array::"INTERVAL DAY TO SECOND"::(vec!["10 20:45:50.123", "10 20:45:50.123", "10 20:45:50.123"])); test_type_valid!(months::"INTERVAL YEAR TO MONTH"::("'1-5'" => Months::new(17), "'-1-5'" => Months::new(-17)));