From 58a310a6e12ea47a57f20bf911e98426c892990e Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Wed, 26 Apr 2017 17:25:55 -0700 Subject: [PATCH] Part 4: add Uuid to query arguments. --- sql/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/src/lib.rs b/sql/src/lib.rs index 08197954..312225dd 100644 --- a/sql/src/lib.rs +++ b/sql/src/lib.rs @@ -140,6 +140,12 @@ impl QueryBuilder for SQLiteQueryBuilder { &Boolean(v) => self.push_sql(if v { "1" } else { "0" }), &Long(v) => self.push_sql(v.to_string().as_str()), &Double(OrderedFloat(v)) => self.push_sql(v.to_string().as_str()), + &Uuid(ref u) => { + // Get a byte array. + let bytes = u.as_bytes().clone(); + let v = Rc::new(rusqlite::types::Value::Blob(bytes.to_vec())); + self.push_static_arg(v); + }, // These are both `Rc`. Unfortunately, we can't use that fact when // turning these into rusqlite Values. &String(ref s) => {