Skip to content

Commit

Permalink
Added DbBackend::boolean_value() for database dependent boolean value
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Nov 12, 2024
1 parent 5fe8576 commit dbbd210
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/database/db_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,15 @@ impl DbBackend {
_ => false,
}
}

/// A getter for database dependent boolean value
pub fn boolean_value(&self, boolean: bool) -> sea_query::Value {
match self {
Self::MySql |
Self::Postgres |
Self::Sqlite => boolean.into(),
}
}
}

#[cfg(test)]
Expand Down

0 comments on commit dbbd210

Please sign in to comment.