From 5b0e115f566dc12dafdbef551617f1b5b04b9576 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 1 Aug 2024 17:24:07 +0800 Subject: [PATCH 1/7] Bump SQLx to 0.8 --- examples/sqlx_any/Cargo.toml | 2 +- examples/sqlx_mysql/Cargo.toml | 2 +- examples/sqlx_postgres/Cargo.toml | 2 +- examples/sqlx_sqlite/Cargo.toml | 2 +- sea-query-binder/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/sqlx_any/Cargo.toml b/examples/sqlx_any/Cargo.toml index 9430b720..e3627d91 100644 --- a/examples/sqlx_any/Cargo.toml +++ b/examples/sqlx_any/Cargo.toml @@ -15,7 +15,7 @@ serde_json = "1" rust_decimal = { version = "1" } bigdecimal = { version = "0.3" } async-std = { version = "1.8", features = [ "attributes" ] } -sqlx = "0.7" +sqlx = "0.8" sea-query = { path = "../../" } sea-query-binder = { path = "../../sea-query-binder", features = [ "sqlx-postgres", diff --git a/examples/sqlx_mysql/Cargo.toml b/examples/sqlx_mysql/Cargo.toml index 40092db3..9db5050d 100644 --- a/examples/sqlx_mysql/Cargo.toml +++ b/examples/sqlx_mysql/Cargo.toml @@ -15,7 +15,7 @@ serde_json = "1" rust_decimal = { version = "1" } bigdecimal = { version = "0.3" } async-std = { version = "1.8", features = [ "attributes" ] } -sqlx = "0.7" +sqlx = "0.8" sea-query = { path = "../../" } sea-query-binder = { path = "../../sea-query-binder", features = [ "sqlx-mysql", diff --git a/examples/sqlx_postgres/Cargo.toml b/examples/sqlx_postgres/Cargo.toml index 17992b0d..f4d4022f 100644 --- a/examples/sqlx_postgres/Cargo.toml +++ b/examples/sqlx_postgres/Cargo.toml @@ -17,7 +17,7 @@ bigdecimal = { version = "0.3" } ipnetwork = { version = "0.20" } mac_address = { version = "1.1" } async-std = { version = "1.8", features = [ "attributes" ] } -sqlx = "0.7" +sqlx = "0.8" sea-query = { path = "../../" } sea-query-binder = { path = "../../sea-query-binder", features = [ "sqlx-postgres", diff --git a/examples/sqlx_sqlite/Cargo.toml b/examples/sqlx_sqlite/Cargo.toml index b4a20c46..c445a646 100644 --- a/examples/sqlx_sqlite/Cargo.toml +++ b/examples/sqlx_sqlite/Cargo.toml @@ -13,7 +13,7 @@ time = { version = "0.3.36", features = ["macros"] } uuid = { version = "1", features = ["serde", "v4"] } serde_json = "1" async-std = { version = "1.8", features = [ "attributes" ] } -sqlx = "0.7" +sqlx = "0.8" sea-query = { path = "../../" } sea-query-binder = { path = "../../sea-query-binder", features = [ "sqlx-sqlite", diff --git a/sea-query-binder/Cargo.toml b/sea-query-binder/Cargo.toml index e37da3bb..e09578e1 100644 --- a/sea-query-binder/Cargo.toml +++ b/sea-query-binder/Cargo.toml @@ -18,7 +18,7 @@ rust-version = "1.60" [dependencies] sea-query = { version = "0.31.0-rc.8", path = "..", default-features = false, features = ["thread-safe"] } -sqlx = { version = "<0.7.5", default-features = false, optional = true } +sqlx = { version = "<0.8.1", default-features = false, optional = true } serde_json = { version = "1", default-features = false, optional = true, features = ["std"] } chrono = { version = "0.4", default-features = false, optional = true, features = ["clock"] } rust_decimal = { version = "1", default-features = false, optional = true } From a09698a456d748ea9199f1909c5fc1d1d2ebd0ad Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 1 Aug 2024 17:41:22 +0800 Subject: [PATCH 2/7] Bump bigdecimal to 0.4 --- Cargo.toml | 2 +- examples/diesel_postgres/Cargo.toml | 2 +- examples/sqlx_any/Cargo.toml | 2 +- examples/sqlx_mysql/Cargo.toml | 2 +- examples/sqlx_postgres/Cargo.toml | 2 +- sea-query-binder/Cargo.toml | 2 +- sea-query-diesel/Cargo.toml | 2 +- sea-query-postgres/Cargo.toml | 2 +- sea-query-rbatis/Cargo.toml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 71b1a03f..00af9e84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ educe = { version = "=0.5.11", default-features = false, optional = true, featur chrono = { version = "0.4.27", default-features = false, optional = true, features = ["clock"] } postgres-types = { version = "0", default-features = false, optional = true } rust_decimal = { version = "1", default-features = false, optional = true } -bigdecimal = { version = "0.3", default-features = false, optional = true } +bigdecimal = { version = "0.4", default-features = false, optional = true } uuid = { version = "1", default-features = false, optional = true } time = { version = "0.3.36", default-features = false, optional = true, features = ["macros", "formatting"] } ipnetwork = { version = "0.20", default-features = false, optional = true } diff --git a/examples/diesel_postgres/Cargo.toml b/examples/diesel_postgres/Cargo.toml index df9e41a7..078dc399 100644 --- a/examples/diesel_postgres/Cargo.toml +++ b/examples/diesel_postgres/Cargo.toml @@ -14,7 +14,7 @@ uuid = { version = "1", features = ["serde", "v4"] } ipnetwork = { version = "0.20" } mac_address = { version = "1.1" } rust_decimal = { version = "1" } -bigdecimal = { version = "0.3" } +bigdecimal = { version = "0.4" } diesel = { version = "2.1.1", features = ["postgres"] } sea-query = { path = "../.." } sea-query-diesel = { path = "../../sea-query-diesel", features = [ diff --git a/examples/sqlx_any/Cargo.toml b/examples/sqlx_any/Cargo.toml index e3627d91..42e58068 100644 --- a/examples/sqlx_any/Cargo.toml +++ b/examples/sqlx_any/Cargo.toml @@ -13,7 +13,7 @@ time = "0.3.36" uuid = { version = "1", features = ["serde", "v4"] } serde_json = "1" rust_decimal = { version = "1" } -bigdecimal = { version = "0.3" } +bigdecimal = { version = "0.4" } async-std = { version = "1.8", features = [ "attributes" ] } sqlx = "0.8" sea-query = { path = "../../" } diff --git a/examples/sqlx_mysql/Cargo.toml b/examples/sqlx_mysql/Cargo.toml index 9db5050d..96527806 100644 --- a/examples/sqlx_mysql/Cargo.toml +++ b/examples/sqlx_mysql/Cargo.toml @@ -13,7 +13,7 @@ time = { version = "0.3.36", features = ["macros"] } uuid = { version = "1", features = ["serde", "v4"] } serde_json = "1" rust_decimal = { version = "1" } -bigdecimal = { version = "0.3" } +bigdecimal = { version = "0.4" } async-std = { version = "1.8", features = [ "attributes" ] } sqlx = "0.8" sea-query = { path = "../../" } diff --git a/examples/sqlx_postgres/Cargo.toml b/examples/sqlx_postgres/Cargo.toml index f4d4022f..81553e5b 100644 --- a/examples/sqlx_postgres/Cargo.toml +++ b/examples/sqlx_postgres/Cargo.toml @@ -13,7 +13,7 @@ time = { version = "0.3.36", features = ["macros"] } uuid = { version = "1", features = ["serde", "v4"] } serde_json = "1" rust_decimal = { version = "1" } -bigdecimal = { version = "0.3" } +bigdecimal = { version = "0.4" } ipnetwork = { version = "0.20" } mac_address = { version = "1.1" } async-std = { version = "1.8", features = [ "attributes" ] } diff --git a/sea-query-binder/Cargo.toml b/sea-query-binder/Cargo.toml index e09578e1..c25c528d 100644 --- a/sea-query-binder/Cargo.toml +++ b/sea-query-binder/Cargo.toml @@ -22,7 +22,7 @@ sqlx = { version = "<0.8.1", default-features = false, optional = true } serde_json = { version = "1", default-features = false, optional = true, features = ["std"] } chrono = { version = "0.4", default-features = false, optional = true, features = ["clock"] } rust_decimal = { version = "1", default-features = false, optional = true } -bigdecimal = { version = "0.3", default-features = false, optional = true } +bigdecimal = { version = "0.4", default-features = false, optional = true } uuid = { version = "1", default-features = false, optional = true } time = { version = "0.3.36", default-features = false, optional = true, features = ["macros", "formatting"] } ipnetwork = { version = "0.20", default-features = false, optional = true } diff --git a/sea-query-diesel/Cargo.toml b/sea-query-diesel/Cargo.toml index 4b661aa4..072b45ef 100644 --- a/sea-query-diesel/Cargo.toml +++ b/sea-query-diesel/Cargo.toml @@ -21,7 +21,7 @@ sea-query = { version = "0.31.0-rc.8", path = "..", default-features = false } diesel = { version = "2.1.1", features = [ "i-implement-a-third-party-backend-and-opt-into-breaking-changes", ] } -bigdecimal = { version = "0.3", default-features = false, optional = true } +bigdecimal = { version = "0.4", default-features = false, optional = true } rust_decimal = { version = "1", default-features = false, optional = true } chrono = { version = "0.4", default-features = false, optional = true } time = { version = "0.3.36", default-features = false, optional = true } diff --git a/sea-query-postgres/Cargo.toml b/sea-query-postgres/Cargo.toml index 131199e6..159f8d18 100644 --- a/sea-query-postgres/Cargo.toml +++ b/sea-query-postgres/Cargo.toml @@ -21,7 +21,7 @@ sea-query = { version = "0.31.0-rc.8", path = "..", default-features = false } postgres-types = { version = "0.2", default-features = false } bytes = { version = "1", default-features = false } rust_decimal = { version = "1", default-features = false, optional = true } -bigdecimal = { version = "0.3", default-features = false, optional = true } +bigdecimal = { version = "0.4", default-features = false, optional = true } ipnetwork = { version = "0.20", default-features = false, optional = true } mac_address = { version = "1.1", default-features = false, optional = true } eui48 = { version = "1", default-features = false, optional = true } diff --git a/sea-query-rbatis/Cargo.toml b/sea-query-rbatis/Cargo.toml index f1bb28db..958a4138 100644 --- a/sea-query-rbatis/Cargo.toml +++ b/sea-query-rbatis/Cargo.toml @@ -22,7 +22,7 @@ rbs = { version = "4.3.1" } serde_json = { version = "1", default-features = false, optional = true, features = ["std"] } chrono = { version = "0.4", default-features = false, optional = true, features = [ "clock"] } rust_decimal = { version = "1", default-features = false, optional = true } -bigdecimal = { version = "0.3", default-features = false, optional = true } +bigdecimal = { version = "0.4", default-features = false, optional = true } uuid = { version = "1", default-features = false, optional = true } time = { version = "0.3.36", default-features = false, optional = true, features = ["macros", "formatting"] } ipnetwork = { version = "0.20", default-features = false, optional = true } From 7ce12322640474eab03a94c7b6fafb39cd52056b Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 1 Aug 2024 17:46:54 +0800 Subject: [PATCH 3/7] Fix clippy warnings --- sea-query-binder/src/sqlx_any.rs | 48 +++++------ sea-query-binder/src/sqlx_mysql.rs | 56 ++++++------ sea-query-binder/src/sqlx_postgres.rs | 120 +++++++++++++------------- sea-query-binder/src/sqlx_sqlite.rs | 56 ++++++------ 4 files changed, 140 insertions(+), 140 deletions(-) diff --git a/sea-query-binder/src/sqlx_any.rs b/sea-query-binder/src/sqlx_any.rs index 1f601924..7c3dd277 100644 --- a/sea-query-binder/src/sqlx_any.rs +++ b/sea-query-binder/src/sqlx_any.rs @@ -8,86 +8,86 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues { use sqlx::Arguments; match arg { Value::Bool(b) => { - args.add(b); + let _ = args.add(b); } Value::TinyInt(i) => { - args.add(i.map(Into::::into)); + let _ = args.add(i.map(Into::::into)); } Value::SmallInt(i) => { - args.add(i.map(Into::::into)); + let _ = args.add(i.map(Into::::into)); } Value::Int(i) => { - args.add(i); + let _ = args.add(i); } Value::BigInt(i) => { - args.add(i); + let _ = args.add(i); } Value::TinyUnsigned(i) => { - args.add(i.map(Into::::into)); + let _ = args.add(i.map(Into::::into)); } Value::SmallUnsigned(i) => { - args.add(i.map(Into::::into)); + let _ = args.add(i.map(Into::::into)); } Value::Unsigned(i) => { - args.add(i.map(Into::::into)); + let _ = args.add(i.map(Into::::into)); } Value::BigUnsigned(i) => { - args.add(i.map(|i| >::try_from(i).unwrap())); + let _ = args.add(i.map(|i| >::try_from(i).unwrap())); } Value::Float(f) => { - args.add(f); + let _ = args.add(f); } Value::Double(d) => { - args.add(d); + let _ = args.add(d); } Value::String(s) => { - args.add(s.map(|s| *s)); + let _ = args.add(s.map(|s| *s)); } Value::Char(c) => { - args.add(c.map(|c| c.to_string())); + let _ = args.add(c.map(|c| c.to_string())); } Value::Bytes(b) => { - args.add(b.map(|b| *b)); + let _ = args.add(b.map(|b| *b)); } #[cfg(feature = "with-chrono")] Value::ChronoDate(t) => { - args.add(Value::ChronoDate(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoDate(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-chrono")] Value::ChronoTime(t) => { - args.add(Value::ChronoTime(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoTime(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTime(t) => { - args.add(Value::ChronoDateTime(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoDateTime(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeUtc(t) => { - args.add(Value::ChronoDateTimeUtc(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoDateTimeUtc(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeLocal(t) => { - args.add(Value::ChronoDateTimeLocal(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoDateTimeLocal(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeWithTimeZone(t) => { - args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeDate(t) => { - args.add(Value::TimeDate(t).time_as_naive_utc_in_string()); + let _ = args.add(Value::TimeDate(t).time_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeTime(t) => { - args.add(Value::TimeTime(t).time_as_naive_utc_in_string()); + let _ = args.add(Value::TimeTime(t).time_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeDateTime(t) => { - args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string()); + let _ = args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeDateTimeWithTimeZone(t) => { - args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string()); + let _ = args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string()); } #[cfg(feature = "with-uuid")] Value::Uuid(_) => { diff --git a/sea-query-binder/src/sqlx_mysql.rs b/sea-query-binder/src/sqlx_mysql.rs index abeac386..ba9eddb6 100644 --- a/sea-query-binder/src/sqlx_mysql.rs +++ b/sea-query-binder/src/sqlx_mysql.rs @@ -8,102 +8,102 @@ impl sqlx::IntoArguments<'_, sqlx::mysql::MySql> for SqlxValues { use sqlx::Arguments; match arg { Value::Bool(b) => { - args.add(b); + let _ = args.add(b); } Value::TinyInt(i) => { - args.add(i); + let _ = args.add(i); } Value::SmallInt(i) => { - args.add(i); + let _ = args.add(i); } Value::Int(i) => { - args.add(i); + let _ = args.add(i); } Value::BigInt(i) => { - args.add(i); + let _ = args.add(i); } Value::TinyUnsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::SmallUnsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::Unsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::BigUnsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::Float(f) => { - args.add(f); + let _ = args.add(f); } Value::Double(d) => { - args.add(d); + let _ = args.add(d); } Value::String(s) => { - args.add(s.as_deref()); + let _ = args.add(s.as_deref()); } Value::Char(c) => { - args.add(c.map(|c| c.to_string())); + let _ = args.add(c.map(|c| c.to_string())); } Value::Bytes(b) => { - args.add(b.as_deref()); + let _ = args.add(b.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDate(d) => { - args.add(d.as_deref()); + let _ = args.add(d.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeUtc(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeLocal(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeWithTimeZone(t) => { - args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); + let _ = args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeDate(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeDateTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeDateTimeWithTimeZone(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-uuid")] Value::Uuid(uuid) => { - args.add(uuid.as_deref()); + let _ = args.add(uuid.as_deref()); } #[cfg(feature = "with-rust_decimal")] Value::Decimal(d) => { - args.add(d.as_deref()); + let _ = args.add(d.as_deref()); } #[cfg(feature = "with-bigdecimal")] Value::BigDecimal(d) => { - args.add(d.as_deref()); + let _ = args.add(d.as_deref()); } #[cfg(feature = "with-json")] Value::Json(j) => { - args.add(j.as_deref()); + let _ = args.add(j.as_deref()); } #[cfg(feature = "postgres-array")] Value::Array(_, _) => { diff --git a/sea-query-binder/src/sqlx_postgres.rs b/sea-query-binder/src/sqlx_postgres.rs index b0fce77a..12c4e70b 100644 --- a/sea-query-binder/src/sqlx_postgres.rs +++ b/sea-query-binder/src/sqlx_postgres.rs @@ -24,158 +24,158 @@ impl sqlx::IntoArguments<'_, sqlx::postgres::Postgres> for SqlxValues { use sqlx::Arguments; match arg { Value::Bool(b) => { - args.add(b); + let _ = args.add(b); } Value::TinyInt(i) => { - args.add(i); + let _ = args.add(i); } Value::SmallInt(i) => { - args.add(i); + let _ = args.add(i); } Value::Int(i) => { - args.add(i); + let _ = args.add(i); } Value::BigInt(i) => { - args.add(i); + let _ = args.add(i); } Value::TinyUnsigned(i) => { - args.add(i.map(|i| i as i16)); + let _ = args.add(i.map(|i| i as i16)); } Value::SmallUnsigned(i) => { - args.add(i.map(|i| i as i32)); + let _ = args.add(i.map(|i| i as i32)); } Value::Unsigned(i) => { - args.add(i.map(|i| i as i64)); + let _ = args.add(i.map(|i| i as i64)); } Value::BigUnsigned(i) => { - args.add(i.map(|i| >::try_from(i).unwrap())); + let _ = args.add(i.map(|i| >::try_from(i).unwrap())); } Value::Float(f) => { - args.add(f); + let _ = args.add(f); } Value::Double(d) => { - args.add(d); + let _ = args.add(d); } Value::String(s) => { - args.add(s.as_deref()); + let _ = args.add(s.as_deref()); } Value::Char(c) => { - args.add(c.map(|c| c.to_string())); + let _ = args.add(c.map(|c| c.to_string())); } Value::Bytes(b) => { - args.add(b.as_deref()); + let _ = args.add(b.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDate(d) => { - args.add(d.as_deref()); + let _ = args.add(d.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeUtc(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeLocal(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeWithTimeZone(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeDate(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeDateTime(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-time")] Value::TimeDateTimeWithTimeZone(t) => { - args.add(t.as_deref()); + let _ = args.add(t.as_deref()); } #[cfg(feature = "with-uuid")] Value::Uuid(uuid) => { - args.add(uuid.as_deref()); + let _ = args.add(uuid.as_deref()); } #[cfg(feature = "with-rust_decimal")] Value::Decimal(d) => { - args.add(d.as_deref()); + let _ = args.add(d.as_deref()); } #[cfg(feature = "with-bigdecimal")] Value::BigDecimal(d) => { - args.add(d.as_deref()); + let _ = args.add(d.as_deref()); } #[cfg(feature = "with-json")] Value::Json(j) => { - args.add(j.as_deref()); + let _ = args.add(j.as_deref()); } #[cfg(feature = "with-ipnetwork")] Value::IpNetwork(ip) => { - args.add(ip.as_deref()); + let _ = args.add(ip.as_deref()); } #[cfg(feature = "with-mac_address")] Value::MacAddress(mac) => { - args.add(mac.as_deref()); + let _ = args.add(mac.as_deref()); } #[cfg(feature = "postgres-array")] Value::Array(ty, v) => match ty { ArrayType::Bool => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Bool"); - args.add(value) + let _ = args.add(value); } ArrayType::TinyInt => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::TinyInt"); - args.add(value) + let _ = args.add(value); } ArrayType::SmallInt => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::SmallInt"); - args.add(value) + let _ = args.add(value); } ArrayType::Int => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Int"); - args.add(value) + let _ = args.add(value); } ArrayType::BigInt => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::BigInt"); - args.add(value) + let _ = args.add(value); } ArrayType::TinyUnsigned => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::TinyUnsigned"); let value: Option> = value.map(|vec| vec.into_iter().map(|i| i as i16).collect()); - args.add(value) + let _ = args.add(value); } ArrayType::SmallUnsigned => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::SmallUnsigned"); let value: Option> = value.map(|vec| vec.into_iter().map(|i| i as i32).collect()); - args.add(value) + let _ = args.add(value); } ArrayType::Unsigned => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Unsigned"); let value: Option> = value.map(|vec| vec.into_iter().map(|i| i as i64).collect()); - args.add(value) + let _ = args.add(value); } ArrayType::BigUnsigned => { let value: Option> = Value::Array(ty, v) @@ -185,133 +185,133 @@ impl sqlx::IntoArguments<'_, sqlx::postgres::Postgres> for SqlxValues { .map(|i| >::try_from(i).unwrap()) .collect() }); - args.add(value) + let _ = args.add(value); } ArrayType::Float => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Float"); - args.add(value) + let _ = args.add(value); } ArrayType::Double => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Double"); - args.add(value) + let _ = args.add(value); } ArrayType::String => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::String"); - args.add(value) + let _ = args.add(value); } ArrayType::Char => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Char"); let value: Option> = value.map(|vec| vec.into_iter().map(|c| c.to_string()).collect()); - args.add(value) + let _ = args.add(value); } ArrayType::Bytes => { let value: Option>> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Bytes"); - args.add(value) + let _ = args.add(value); } #[cfg(feature = "with-chrono")] ArrayType::ChronoDate => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::ChronoDate"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-chrono")] ArrayType::ChronoTime => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::ChronoTime"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-chrono")] ArrayType::ChronoDateTime => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::ChronoDateTime"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-chrono")] ArrayType::ChronoDateTimeUtc => { let value: Option>> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::ChronoDateTimeUtc"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-chrono")] ArrayType::ChronoDateTimeLocal => { let value: Option>> = Value::Array(ty, v).expect( "This Value::Array should consist of Value::ChronoDateTimeLocal", ); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-chrono")] ArrayType::ChronoDateTimeWithTimeZone => { let value: Option>> = Value::Array(ty, v).expect( "This Value::Array should consist of Value::ChronoDateTimeWithTimeZone", ); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-time")] ArrayType::TimeDate => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::TimeDate"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-time")] ArrayType::TimeTime => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::TimeTime"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-time")] ArrayType::TimeDateTime => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::TimeDateTime"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-time")] ArrayType::TimeDateTimeWithTimeZone => { let value: Option> = Value::Array(ty, v).expect( "This Value::Array should consist of Value::TimeDateTimeWithTimeZone", ); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-uuid")] ArrayType::Uuid => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Uuid"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-rust_decimal")] ArrayType::Decimal => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Decimal"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-bigdecimal")] ArrayType::BigDecimal => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::BigDecimal"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-json")] ArrayType::Json => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::Json"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-ipnetwork")] ArrayType::IpNetwork => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::IpNetwork"); - args.add(value); + let _ = args.add(value); } #[cfg(feature = "with-mac_address")] ArrayType::MacAddress => { let value: Option> = Value::Array(ty, v) .expect("This Value::Array should consist of Value::MacAddress"); - args.add(value); + let _ = args.add(value); } }, } diff --git a/sea-query-binder/src/sqlx_sqlite.rs b/sea-query-binder/src/sqlx_sqlite.rs index 1865ba6f..9be0af0b 100644 --- a/sea-query-binder/src/sqlx_sqlite.rs +++ b/sea-query-binder/src/sqlx_sqlite.rs @@ -8,104 +8,104 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::sqlite::Sqlite> for SqlxValues { use sqlx::Arguments; match arg { Value::Bool(b) => { - args.add(b); + let _ = args.add(b); } Value::TinyInt(i) => { - args.add(i); + let _ = args.add(i); } Value::SmallInt(i) => { - args.add(i); + let _ = args.add(i); } Value::Int(i) => { - args.add(i); + let _ = args.add(i); } Value::BigInt(i) => { - args.add(i); + let _ = args.add(i); } Value::TinyUnsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::SmallUnsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::Unsigned(i) => { - args.add(i); + let _ = args.add(i); } Value::BigUnsigned(i) => { - args.add(i.map(|i| >::try_from(i).unwrap())); + let _ = args.add(i.map(|i| >::try_from(i).unwrap())); } Value::Float(f) => { - args.add(f); + let _ = args.add(f); } Value::Double(d) => { - args.add(d); + let _ = args.add(d); } Value::String(s) => { - args.add(s.map(|s| *s)); + let _ = args.add(s.map(|s| *s)); } Value::Char(c) => { - args.add(c.map(|c| c.to_string())); + let _ = args.add(c.map(|c| c.to_string())); } Value::Bytes(b) => { - args.add(b.map(|b| *b)); + let _ = args.add(b.map(|b| *b)); } #[cfg(feature = "with-chrono")] Value::ChronoDate(d) => { - args.add(d.map(|d| *d)); + let _ = args.add(d.map(|d| *d)); } #[cfg(feature = "with-chrono")] Value::ChronoTime(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-chrono")] Value::ChronoDateTime(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeUtc(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeLocal(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeWithTimeZone(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-time")] Value::TimeDate(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-time")] Value::TimeTime(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-time")] Value::TimeDateTime(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-time")] Value::TimeDateTimeWithTimeZone(t) => { - args.add(t.map(|t| *t)); + let _ = args.add(t.map(|t| *t)); } #[cfg(feature = "with-uuid")] Value::Uuid(uuid) => { - args.add(uuid.map(|uuid| *uuid)); + let _ = args.add(uuid.map(|uuid| *uuid)); } #[cfg(feature = "with-rust_decimal")] Value::Decimal(decimal) => { use rust_decimal::prelude::ToPrimitive; - args.add(decimal.map(|d| d.to_string())); + let _ = args.add(decimal.map(|d| d.to_string())); } #[cfg(feature = "with-bigdecimal")] Value::BigDecimal(big_decimal) => { use bigdecimal::ToPrimitive; - args.add(big_decimal.map(|d| d.to_string())); + let _ = args.add(big_decimal.map(|d| d.to_string())); } #[cfg(feature = "with-json")] Value::Json(j) => { - args.add(j.map(|j| *j)); + let _ = args.add(j.map(|j| *j)); } #[cfg(feature = "with-ipnetwork")] Value::IpNetwork(_) => { From 6c61456e227e07396a6142b58acc3e26e158f96e Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 1 Aug 2024 17:47:03 +0800 Subject: [PATCH 4/7] Fix clippy warnings --- src/backend/mysql/table.rs | 2 +- src/backend/postgres/table.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/mysql/table.rs b/src/backend/mysql/table.rs index 562ec36b..ec359412 100644 --- a/src/backend/mysql/table.rs +++ b/src/backend/mysql/table.rs @@ -153,7 +153,7 @@ impl TableBuilder for MysqlQueryBuilder { } TableAlterOption::DropForeignKey(name) => { let mut foreign_key = TableForeignKey::new(); - foreign_key.name(&name.to_string()); + foreign_key.name(name.to_string()); let drop = ForeignKeyDropStatement { foreign_key, table: None, diff --git a/src/backend/postgres/table.rs b/src/backend/postgres/table.rs index a022d1d7..c45dbc7e 100644 --- a/src/backend/postgres/table.rs +++ b/src/backend/postgres/table.rs @@ -192,7 +192,7 @@ impl TableBuilder for PostgresQueryBuilder { } TableAlterOption::DropForeignKey(name) => { let mut foreign_key = TableForeignKey::new(); - foreign_key.name(&name.to_string()); + foreign_key.name(name.to_string()); let drop = ForeignKeyDropStatement { foreign_key, table: None, From 575c80347ab33290340b642f21cd5b9aa9ed1d73 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 1 Aug 2024 17:48:58 +0800 Subject: [PATCH 5/7] fmt --- sea-query-binder/src/sqlx_any.rs | 9 ++++++--- sea-query-binder/src/sqlx_mysql.rs | 3 ++- sea-query-binder/src/sqlx_sqlite.rs | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sea-query-binder/src/sqlx_any.rs b/sea-query-binder/src/sqlx_any.rs index 7c3dd277..5a73fca2 100644 --- a/sea-query-binder/src/sqlx_any.rs +++ b/sea-query-binder/src/sqlx_any.rs @@ -32,7 +32,8 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues { let _ = args.add(i.map(Into::::into)); } Value::BigUnsigned(i) => { - let _ = args.add(i.map(|i| >::try_from(i).unwrap())); + let _ = args + .add(i.map(|i| >::try_from(i).unwrap())); } Value::Float(f) => { let _ = args.add(f); @@ -71,7 +72,8 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues { } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeWithTimeZone(t) => { - let _ = args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); + let _ = args + .add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeDate(t) => { @@ -87,7 +89,8 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues { } #[cfg(feature = "with-time")] Value::TimeDateTimeWithTimeZone(t) => { - let _ = args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string()); + let _ = + args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string()); } #[cfg(feature = "with-uuid")] Value::Uuid(_) => { diff --git a/sea-query-binder/src/sqlx_mysql.rs b/sea-query-binder/src/sqlx_mysql.rs index ba9eddb6..08c34ba4 100644 --- a/sea-query-binder/src/sqlx_mysql.rs +++ b/sea-query-binder/src/sqlx_mysql.rs @@ -71,7 +71,8 @@ impl sqlx::IntoArguments<'_, sqlx::mysql::MySql> for SqlxValues { } #[cfg(feature = "with-chrono")] Value::ChronoDateTimeWithTimeZone(t) => { - let _ = args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); + let _ = args + .add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string()); } #[cfg(feature = "with-time")] Value::TimeDate(t) => { diff --git a/sea-query-binder/src/sqlx_sqlite.rs b/sea-query-binder/src/sqlx_sqlite.rs index 9be0af0b..14384d7b 100644 --- a/sea-query-binder/src/sqlx_sqlite.rs +++ b/sea-query-binder/src/sqlx_sqlite.rs @@ -32,7 +32,8 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::sqlite::Sqlite> for SqlxValues { let _ = args.add(i); } Value::BigUnsigned(i) => { - let _ = args.add(i.map(|i| >::try_from(i).unwrap())); + let _ = args + .add(i.map(|i| >::try_from(i).unwrap())); } Value::Float(f) => { let _ = args.add(f); From 0a4d834984ecf443f308ce3f3d150e1e43b0b0a2 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Fri, 2 Aug 2024 12:04:17 +0800 Subject: [PATCH 6/7] Fix --- .github/workflows/diesel.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/diesel.yml b/.github/workflows/diesel.yml index 99879fa5..3a4d3d96 100644 --- a/.github/workflows/diesel.yml +++ b/.github/workflows/diesel.yml @@ -44,7 +44,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - - run: cargo update --manifest-path sea-query-diesel/Cargo.toml --workspace -p bigdecimal:0.4.5 --precise 0.3.1 - run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array - run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-chrono - run: cargo build --manifest-path sea-query-diesel/Cargo.toml --workspace --features postgres,sqlite,mysql --features=with-json @@ -157,6 +156,5 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - - run: cargo update --manifest-path examples/${{ matrix.example }}/Cargo.toml -p bigdecimal:0.4.5 --precise 0.3.1 - run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml - run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml From cccb3a1a2cf1ef7a89b0cc004cb71568daec4bfc Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Fri, 9 Aug 2024 17:22:41 +0800 Subject: [PATCH 7/7] Upgrade `pgvector` to 0.4 --- Cargo.toml | 2 +- sea-query-binder/Cargo.toml | 2 +- sea-query-diesel/Cargo.toml | 2 +- sea-query-postgres/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a9234813..6b817f24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ serde_json = { version = "1", default-features = false, optional = true, feature educe = { version = "=0.5.11", default-features = false, optional = true, features = ["Hash", "PartialEq", "Eq"] } chrono = { version = "0.4.27", default-features = false, optional = true, features = ["clock"] } postgres-types = { version = "0", default-features = false, optional = true } -pgvector = { version = "<0.4", default-features = false, optional = true } +pgvector = { version = "~0.4", default-features = false, optional = true } rust_decimal = { version = "1", default-features = false, optional = true } bigdecimal = { version = "0.4", default-features = false, optional = true } uuid = { version = "1", default-features = false, optional = true } diff --git a/sea-query-binder/Cargo.toml b/sea-query-binder/Cargo.toml index 1ed18e29..e9282cb9 100644 --- a/sea-query-binder/Cargo.toml +++ b/sea-query-binder/Cargo.toml @@ -27,7 +27,7 @@ uuid = { version = "1", default-features = false, optional = true } time = { version = "0.3.36", default-features = false, optional = true, features = ["macros", "formatting"] } ipnetwork = { version = "0.20", default-features = false, optional = true } mac_address = { version = "1.1", default-features = false, optional = true } -pgvector = { version = "<0.4", default-features = false, optional = true } +pgvector = { version = "~0.4", default-features = false, optional = true } [features] sqlx-mysql = ["sqlx/mysql"] diff --git a/sea-query-diesel/Cargo.toml b/sea-query-diesel/Cargo.toml index 0e154551..3315f6ab 100644 --- a/sea-query-diesel/Cargo.toml +++ b/sea-query-diesel/Cargo.toml @@ -29,7 +29,7 @@ uuid = { version = "1", default-features = false, optional = true } serde_json = { version = "1", default-features = false, optional = true } ipnetwork = { version = "0.20", default-features = false, optional = true } mac_address = { version = "1.1", default-features = false, optional = true } -pgvector = { version = "<0.4", default-features = false, optional = true } +pgvector = { version = "~0.4", default-features = false, optional = true } [features] default = [] diff --git a/sea-query-postgres/Cargo.toml b/sea-query-postgres/Cargo.toml index 84cd8ab4..0d55192c 100644 --- a/sea-query-postgres/Cargo.toml +++ b/sea-query-postgres/Cargo.toml @@ -19,7 +19,7 @@ rust-version = "1.60" [dependencies] sea-query = { version = "0.31.0", path = "..", default-features = false } postgres-types = { version = "0.2", default-features = false } -pgvector = { version = "<0.4", default-features = false, optional = true } +pgvector = { version = "~0.4", default-features = false, optional = true } bytes = { version = "1", default-features = false } rust_decimal = { version = "1", default-features = false, optional = true } bigdecimal = { version = "0.4", default-features = false, optional = true }