From 4f84b2a3eda7494b10509a6a900b0b67f4ef513e Mon Sep 17 00:00:00 2001 From: Bat Date: Mon, 8 Oct 2018 18:58:15 +0100 Subject: [PATCH] Impl SQL traits for SafeString only for the selected backend Fixes #269 --- plume-models/src/.lib.rs.swp | Bin 0 -> 1024 bytes plume-models/src/safe_string.rs | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 plume-models/src/.lib.rs.swp diff --git a/plume-models/src/.lib.rs.swp b/plume-models/src/.lib.rs.swp new file mode 100644 index 0000000000000000000000000000000000000000..3d353cea15dee3bc5b08c8124c05d33cd7bbd506 GIT binary patch literal 1024 zcmYc?$V<%2S1{7E)H7y40vEj)7?KhTN-~Q}QjvtQG7IuEi&7IybraLlQj<$cQ%ftb dDq|=vO4iTGOwubV#x6f9IvN6_Awb^{001Pk65{{> literal 0 HcmV?d00001 diff --git a/plume-models/src/safe_string.rs b/plume-models/src/safe_string.rs index ce813d45..26c7a210 100644 --- a/plume-models/src/safe_string.rs +++ b/plume-models/src/safe_string.rs @@ -85,6 +85,7 @@ impl<'de> Deserialize<'de> for SafeString { } } +#[cfg(all(feature = "postgres", not(feature = "sqlite")))] impl Queryable for SafeString { type Row = String; fn build(value: Self::Row) -> Self { @@ -92,6 +93,7 @@ impl Queryable for SafeString { } } +#[cfg(all(feature = "sqlite", not(feature = "postgres")))] impl Queryable for SafeString { type Row = String; fn build(value: Self::Row) -> Self { @@ -99,6 +101,7 @@ impl Queryable for SafeString { } } + impl ToSql for SafeString where DB: diesel::backend::Backend,