mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-14 07:51:01 +00:00
Impl SQL traits for SafeString only for the selected backend
Fixes #269
This commit is contained in:
parent
0469b8dae2
commit
4f84b2a3ed
2 changed files with 3 additions and 0 deletions
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 {
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue