Skip to content

Commit 95dcfbe

Browse files
authored
Fix conversion of TIMESTAMPTZ values to proxy row in postgres driver (#3004)
1 parent b11cc5e commit 95dcfbe

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/driver/sqlx_postgres.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,8 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) -
819819
.expect("Failed to get timestamptz"),
820820
),
821821
#[cfg(all(feature = "with-time", not(feature = "with-chrono")))]
822-
"TIMESTAMPTZ" => Value::TimeDateTime(
823-
row.try_get::<Option<time::PrimitiveDateTime>, _>(c.ordinal())
822+
"TIMESTAMPTZ" => Value::TimeDateTimeWithTimeZone(
823+
row.try_get::<Option<time::OffsetDateTime>, _>(c.ordinal())
824824
.expect("Failed to get timestamptz"),
825825
),
826826

@@ -845,13 +845,13 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) -
845845
feature = "postgres-array"
846846
))]
847847
"TIMESTAMPTZ[]" => Value::Array(
848-
sea_query::ArrayType::TimeDateTime,
849-
row.try_get::<Option<Vec<time::PrimitiveDateTime>>, _>(c.ordinal())
848+
sea_query::ArrayType::TimeDateTimeWithTimeZone,
849+
row.try_get::<Option<Vec<time::OffsetDateTime>>, _>(c.ordinal())
850850
.expect("Failed to get timestamptz array")
851851
.map(|vals| {
852852
Box::new(
853853
vals.into_iter()
854-
.map(|val| Value::TimeDateTime(Some(val)))
854+
.map(|val| Value::TimeDateTimeWithTimeZone(Some(val)))
855855
.collect(),
856856
)
857857
}),

0 commit comments

Comments
 (0)