diff --git a/sqlx-core/src/types/json.rs b/sqlx-core/src/types/json.rs index c0ef6b4d68..a8fd269012 100644 --- a/sqlx-core/src/types/json.rs +++ b/sqlx-core/src/types/json.rs @@ -57,6 +57,18 @@ use crate::types::Type; #[serde(transparent)] pub struct Json(pub T); +impl From for Json { + fn from(value: T) -> Self { + Self(value) + } +} + +impl From> for T { + fn from(Json(value): Json) -> Self { + value + } +} + impl Deref for Json { type Target = T;