From 0e22e33f5e2eb2810746c9a106f6ea05df07fa9e Mon Sep 17 00:00:00 2001 From: chrxn1c Date: Thu, 11 Dec 2025 17:01:46 +0300 Subject: [PATCH] feat: add self-extractor for JSON type --- sqlx-core/src/types/json.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sqlx-core/src/types/json.rs b/sqlx-core/src/types/json.rs index 3b94d8729b..6616ce1a7d 100644 --- a/sqlx-core/src/types/json.rs +++ b/sqlx-core/src/types/json.rs @@ -86,6 +86,13 @@ use crate::types::Type; #[serde(transparent)] pub struct Json(pub T); +impl Json { + /// Extract the inner value. + pub fn into_inner(self) -> T { + self.0 + } +} + impl From for Json { fn from(value: T) -> Self { Self(value)