Impl SQL traits for SafeString only for the selected backend
Fixes #269
This commit is contained in:
Binary file not shown.
@@ -85,6 +85,7 @@ impl<'de> Deserialize<'de> for SafeString {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "postgres", not(feature = "sqlite")))]
|
||||
impl Queryable<Text, diesel::pg::Pg> for SafeString {
|
||||
type Row = String;
|
||||
fn build(value: Self::Row) -> Self {
|
||||
@@ -92,6 +93,7 @@ impl Queryable<Text, diesel::pg::Pg> for SafeString {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "sqlite", not(feature = "postgres")))]
|
||||
impl Queryable<Text, diesel::sqlite::Sqlite> for SafeString {
|
||||
type Row = String;
|
||||
fn build(value: Self::Row) -> Self {
|
||||
@@ -99,6 +101,7 @@ impl Queryable<Text, diesel::sqlite::Sqlite> for SafeString {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl<DB> ToSql<diesel::sql_types::Text, DB> for SafeString
|
||||
where
|
||||
DB: diesel::backend::Backend,
|
||||
|
||||
Reference in New Issue
Block a user