From 16f07d451232151f7a5febc63edbe21f35c54c28 Mon Sep 17 00:00:00 2001 From: caisin Date: Sun, 1 Feb 2026 00:16:50 +0800 Subject: [PATCH] fix: proxy error --- src/driver/sqlx_postgres.rs | 71 +++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/driver/sqlx_postgres.rs b/src/driver/sqlx_postgres.rs index 142dd37f7..2fd3e2a26 100644 --- a/src/driver/sqlx_postgres.rs +++ b/src/driver/sqlx_postgres.rs @@ -523,7 +523,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "VARCHAR" | "CHAR" | "TEXT" | "NAME" => Value::String( row.try_get::, _>(c.ordinal()) .expect("Failed to get string") - .map(Box::new), + , ), #[cfg(feature = "postgres-array")] "VARCHAR[]" | "CHAR[]" | "TEXT[]" | "NAME[]" => Value::Array( @@ -533,7 +533,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::String(Some(Box::new(val)))) + .map(|val| Value::String(Some(val))) .collect(), ) }), @@ -542,7 +542,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "BYTEA" => Value::Bytes( row.try_get::>, _>(c.ordinal()) .expect("Failed to get bytes") - .map(Box::new), + , ), #[cfg(feature = "postgres-array")] "BYTEA[]" => Value::Array( @@ -552,7 +552,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::Bytes(Some(Box::new(val)))) + .map(|val| Value::Bytes(Some(val))) .collect(), ) }), @@ -562,7 +562,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "NUMERIC" => Value::BigDecimal( row.try_get::, _>(c.ordinal()) .expect("Failed to get numeric") - .map(Box::new), + , ), #[cfg(all( feature = "with-rust_decimal", @@ -571,7 +571,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "NUMERIC" => Value::Decimal( row.try_get(c.ordinal()) .expect("Failed to get numeric") - .map(Box::new), + , ), #[cfg(all(feature = "with-bigdecimal", feature = "postgres-array"))] @@ -582,7 +582,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::BigDecimal(Some(Box::new(val)))) + .map(|val| Value::BigDecimal(Some(val))) .collect(), ) }), @@ -599,7 +599,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::Decimal(Some(Box::new(val)))) + .map(|val| Value::Decimal(Some(val))) .collect(), ) }), @@ -625,7 +625,8 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "JSON" | "JSONB" => Value::Json( row.try_get::, _>(c.ordinal()) .expect("Failed to get json") - .map(Box::new), + .map(Box::new) + , ), #[cfg(any(feature = "json-array", feature = "postgres-array"))] "JSON[]" | "JSONB[]" => Value::Array( @@ -645,7 +646,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "INET" | "CIDR" => Value::IpNetwork( row.try_get::, _>(c.ordinal()) .expect("Failed to get ip address") - .map(Box::new), + , ), #[cfg(feature = "with-ipnetwork")] "INET[]" | "CIDR[]" => Value::Array( @@ -655,7 +656,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::IpNetwork(Some(Box::new(val)))) + .map(|val| Value::IpNetwork(Some(val))) .collect(), ) }), @@ -665,7 +666,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "MACADDR" | "MACADDR8" => Value::MacAddress( row.try_get::, _>(c.ordinal()) .expect("Failed to get mac address") - .map(Box::new), + , ), #[cfg(all(feature = "with-mac_address", feature = "postgres-array"))] "MACADDR[]" | "MACADDR8[]" => Value::Array( @@ -675,7 +676,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::MacAddress(Some(Box::new(val)))) + .map(|val| Value::MacAddress(Some(val))) .collect(), ) }), @@ -685,13 +686,13 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "TIMESTAMP" => Value::ChronoDateTime( row.try_get::, _>(c.ordinal()) .expect("Failed to get timestamp") - .map(Box::new), + , ), #[cfg(all(feature = "with-time", not(feature = "with-chrono")))] "TIMESTAMP" => Value::TimeDateTime( row.try_get::, _>(c.ordinal()) .expect("Failed to get timestamp") - .map(Box::new), + , ), #[cfg(all(feature = "with-chrono", feature = "postgres-array"))] @@ -702,7 +703,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::ChronoDateTime(Some(Box::new(val)))) + .map(|val| Value::ChronoDateTime(Some(val))) .collect(), ) }), @@ -719,7 +720,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::TimeDateTime(Some(Box::new(val)))) + .map(|val| Value::TimeDateTime(Some(val))) .collect(), ) }), @@ -729,13 +730,13 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "DATE" => Value::ChronoDate( row.try_get::, _>(c.ordinal()) .expect("Failed to get date") - .map(Box::new), + , ), #[cfg(all(feature = "with-time", not(feature = "with-chrono")))] "DATE" => Value::TimeDate( row.try_get::, _>(c.ordinal()) .expect("Failed to get date") - .map(Box::new), + , ), #[cfg(all(feature = "with-chrono", feature = "postgres-array"))] @@ -746,7 +747,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::ChronoDate(Some(Box::new(val)))) + .map(|val| Value::ChronoDate(Some(val))) .collect(), ) }), @@ -763,7 +764,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::TimeDate(Some(Box::new(val)))) + .map(|val| Value::TimeDate(Some(val))) .collect(), ) }), @@ -773,13 +774,13 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "TIME" => Value::ChronoTime( row.try_get::, _>(c.ordinal()) .expect("Failed to get time") - .map(Box::new), + , ), #[cfg(all(feature = "with-time", not(feature = "with-chrono")))] "TIME" => Value::TimeTime( row.try_get::, _>(c.ordinal()) .expect("Failed to get time") - .map(Box::new), + , ), #[cfg(all(feature = "with-chrono", feature = "postgres-array"))] @@ -790,7 +791,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::ChronoTime(Some(Box::new(val)))) + .map(|val| Value::ChronoTime(Some(val))) .collect(), ) }), @@ -807,7 +808,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::TimeTime(Some(Box::new(val)))) + .map(|val| Value::TimeTime(Some(val))) .collect(), ) }), @@ -817,13 +818,13 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "TIMESTAMPTZ" => Value::ChronoDateTimeUtc( row.try_get::>, _>(c.ordinal()) .expect("Failed to get timestamptz") - .map(Box::new), + , ), #[cfg(all(feature = "with-time", not(feature = "with-chrono")))] "TIMESTAMPTZ" => Value::TimeDateTime( row.try_get::, _>(c.ordinal()) .expect("Failed to get timestamptz") - .map(Box::new), + , ), #[cfg(all(feature = "with-chrono", feature = "postgres-array"))] @@ -836,7 +837,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::ChronoDateTimeUtc(Some(Box::new(val)))) + .map(|val| Value::ChronoDateTimeUtc(Some(val))) .collect(), ) }), @@ -853,7 +854,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::TimeDateTime(Some(Box::new(val)))) + .map(|val| Value::TimeDateTime(Some(val))) .collect(), ) }), @@ -863,13 +864,13 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "TIMETZ" => Value::ChronoTime( row.try_get::, _>(c.ordinal()) .expect("Failed to get timetz") - .map(Box::new), + , ), #[cfg(all(feature = "with-time", not(feature = "with-chrono")))] "TIMETZ" => Value::TimeTime( row.try_get(c.ordinal()) .expect("Failed to get timetz") - .map(Box::new), + , ), #[cfg(all(feature = "with-chrono", feature = "postgres-array"))] @@ -880,7 +881,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::ChronoTime(Some(Box::new(val)))) + .map(|val| Value::ChronoTime(Some(val))) .collect(), ) }), @@ -897,7 +898,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::TimeTime(Some(Box::new(val)))) + .map(|val| Value::TimeTime(Some(val))) .collect(), ) }), @@ -907,7 +908,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - "UUID" => Value::Uuid( row.try_get::, _>(c.ordinal()) .expect("Failed to get uuid") - .map(Box::new), + , ), #[cfg(all(feature = "with-uuid", feature = "postgres-array"))] @@ -918,7 +919,7 @@ pub(crate) fn from_sqlx_postgres_row_to_proxy_row(row: &sqlx::postgres::PgRow) - .map(|vals| { Box::new( vals.into_iter() - .map(|val| Value::Uuid(Some(Box::new(val)))) + .map(|val| Value::Uuid(Some(val))) .collect(), ) }),