Add ToSql impl for bool.

This commit is contained in:
John Gallagher 2016-05-26 00:05:00 -04:00
parent 9125826534
commit 13bff6fab6
2 changed files with 7 additions and 0 deletions

View File

@ -49,6 +49,7 @@ macro_rules! to_sql_self(
);
to_sql_self!(Null);
to_sql_self!(bool);
to_sql_self!(i32);
to_sql_self!(i64);
to_sql_self!(f64);

View File

@ -24,6 +24,12 @@ impl From<Null> for Value {
}
}
impl From<bool> for Value {
fn from(i: bool) -> Value {
Value::Integer(i as i64)
}
}
impl From<i32> for Value {
fn from(i: i32) -> Value {
Value::Integer(i as i64)