Skip to content

Commit d6d8b24

Browse files
Huliiiiiityt2y3
authored andcommitted
Fix incorrect casting from DateTime<Local> to ChronoDateTimeWithTimeZone in Value::Array (#933)
## PR Info - Closes #662 ## Bug Fixes - [x] Fix incorrect casting from `DateTime<Local>` to `ChronoDateTimeWithTimeZone` in `Value::Array`
1 parent b09f0ed commit d6d8b24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sea-query-binder/src/sqlx_postgres.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(feature = "with-bigdecimal")]
22
use bigdecimal::BigDecimal;
33
#[cfg(feature = "with-chrono")]
4-
use chrono::{DateTime, Local, NaiveDate, NaiveDateTime, NaiveTime, Utc};
4+
use chrono::{DateTime, FixedOffset, Local, NaiveDate, NaiveDateTime, NaiveTime, Utc};
55
#[cfg(feature = "with-ipnetwork")]
66
use ipnetwork::IpNetwork;
77
#[cfg(feature = "with-mac_address")]
@@ -247,7 +247,7 @@ impl sqlx::IntoArguments<'_, sqlx::postgres::Postgres> for SqlxValues {
247247
}
248248
#[cfg(feature = "with-chrono")]
249249
ArrayType::ChronoDateTimeWithTimeZone => {
250-
let value: Option<Vec<DateTime<Local>>> = Value::Array(ty, v).expect(
250+
let value: Option<Vec<DateTime<FixedOffset>>> = Value::Array(ty, v).expect(
251251
"This Value::Array should consist of Value::ChronoDateTimeWithTimeZone",
252252
);
253253
let _ = args.add(value);

0 commit comments

Comments
 (0)