Impl SQL traits for SafeString only for the selected backend
Fixes #269
This commit is contained in:
parent
0469b8dae2
commit
4f84b2a3ed
BIN
plume-models/src/.lib.rs.swp
Normal file
BIN
plume-models/src/.lib.rs.swp
Normal file
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 {
|
impl Queryable<Text, diesel::pg::Pg> for SafeString {
|
||||||
type Row = String;
|
type Row = String;
|
||||||
fn build(value: Self::Row) -> Self {
|
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 {
|
impl Queryable<Text, diesel::sqlite::Sqlite> for SafeString {
|
||||||
type Row = String;
|
type Row = String;
|
||||||
fn build(value: Self::Row) -> Self {
|
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
|
impl<DB> ToSql<diesel::sql_types::Text, DB> for SafeString
|
||||||
where
|
where
|
||||||
DB: diesel::backend::Backend,
|
DB: diesel::backend::Backend,
|
||||||
|
Loading…
Reference in New Issue
Block a user