|
@@ -26,6 +26,18 @@ integral!(u32);
|
|
integral!(i64);
|
|
integral!(i64);
|
|
integral!(u64);
|
|
integral!(u64);
|
|
|
|
|
|
|
|
+impl Modelable for f64 {
|
|
|
|
+ fn bind_to(&self, stmt: &mut sqlite::Statement, col: usize) -> sqlite::Result<()> {
|
|
|
|
+ self.bind(stmt, col)
|
|
|
|
+ }
|
|
|
|
+ fn build_from(stmt: &sqlite::Statement, col_offset: usize) -> sqlite::Result<(Self, usize)>
|
|
|
|
+ where
|
|
|
|
+ Self: Sized,
|
|
|
|
+ {
|
|
|
|
+ stmt.read(col_offset).map(|x| (x, 1))
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
impl Modelable for bool {
|
|
impl Modelable for bool {
|
|
fn bind_to(&self, stmt: &mut sqlite::Statement, col: usize) -> sqlite::Result<()> {
|
|
fn bind_to(&self, stmt: &mut sqlite::Statement, col: usize) -> sqlite::Result<()> {
|
|
let val = if self == &true { 1i64 } else { 0i64 };
|
|
let val = if self == &true { 1i64 } else { 0i64 };
|