mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-29 21:08:55 +08:00
Make query_row a synonym for query_row_safe.
This is a breaking change for anyone using `query_row`. To update code that used the old `query_row`, you must now `.unwrap()` the returned result.
This commit is contained in:
@@ -246,7 +246,7 @@ mod test {
|
||||
let v1234 = vec![1u8,2,3,4];
|
||||
db.execute("INSERT INTO foo(b) VALUES (?)", &[&v1234]).unwrap();
|
||||
|
||||
let v: Vec<u8> = db.query_row("SELECT b FROM foo", &[], |r| r.get(0));
|
||||
let v: Vec<u8> = db.query_row("SELECT b FROM foo", &[], |r| r.get(0)).unwrap();
|
||||
assert_eq!(v, v1234);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ mod test {
|
||||
let s = "hello, world!";
|
||||
db.execute("INSERT INTO foo(t) VALUES (?)", &[&s.to_string()]).unwrap();
|
||||
|
||||
let from: String = db.query_row("SELECT t FROM foo", &[], |r| r.get(0));
|
||||
let from: String = db.query_row("SELECT t FROM foo", &[], |r| r.get(0)).unwrap();
|
||||
assert_eq!(from, s);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ mod test {
|
||||
let ts = time::Timespec{sec: 10_000, nsec: 0 };
|
||||
db.execute("INSERT INTO foo(t) VALUES (?)", &[&ts]).unwrap();
|
||||
|
||||
let from: time::Timespec = db.query_row("SELECT t FROM foo", &[], |r| r.get(0));
|
||||
let from: time::Timespec = db.query_row("SELECT t FROM foo", &[], |r| r.get(0)).unwrap();
|
||||
assert_eq!(from, ts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user