From 01858bf4ca3bd13128b6186a0f84311677cbd63c Mon Sep 17 00:00:00 2001 From: Aman Sharma <35651798+lunchspider@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:13:50 +0530 Subject: [PATCH] adds From for sql::Value and sql::Uuid (#1398) --- lib/src/sql/uuid.rs | 6 ++++++ lib/src/sql/value/value.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/src/sql/uuid.rs b/lib/src/sql/uuid.rs index 2bfd1d11..1e16e8c1 100644 --- a/lib/src/sql/uuid.rs +++ b/lib/src/sql/uuid.rs @@ -22,6 +22,12 @@ impl From<&str> for Uuid { } } +impl From for Uuid{ + fn from(v: uuid::Uuid) -> Self { + Uuid(v) + } +} + impl From for Uuid { fn from(s: String) -> Self { Self::from(s.as_str()) diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index cb38a4a6..257f01a2 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -155,6 +155,12 @@ impl From for Value { } } +impl From for Value{ + fn from(v: uuid::Uuid) -> Self { + Value::Uuid(Uuid(v)) + } +} + impl From for Value { fn from(v: Param) -> Self { Value::Param(v)