This commit is contained in:
gwenn 2023-04-16 18:09:15 +02:00
parent b59b0ddf2e
commit 0e369ba878
3 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
///! Busy handler (when the database is locked) //! Busy handler (when the database is locked)
use std::convert::TryInto; use std::convert::TryInto;
use std::mem; use std::mem;
use std::os::raw::{c_int, c_void}; use std::os::raw::{c_int, c_void};

View File

@ -2120,7 +2120,11 @@ mod test {
let name = "Lisa"; let name = "Lisa";
let age = 8; let age = 8;
let mut stmt = prepare_and_bind!(db, "SELECT $name, $age;"); let mut stmt = prepare_and_bind!(db, "SELECT $name, $age;");
let (v1, v2) = stmt.raw_query().get_expected_row().and_then(|r| Ok((r.get::<_,String>(0)?, r.get::<_,i64>(1)?)))?; let (v1, v2) = stmt
.raw_query()
.next()
.and_then(|o| o.ok_or(Error::QueryReturnedNoRows))
.and_then(|r| Ok((r.get::<_, String>(0)?, r.get::<_, i64>(1)?)))?;
assert_eq!((v1.as_str(), v2), (name, age)); assert_eq!((v1.as_str(), v2), (name, age));
Ok(()) Ok(())
} }

View File

@ -1,4 +1,4 @@
///! Port of C [vtablog](http://www.sqlite.org/cgi/src/finfo?name=ext/misc/vtablog.c) //! Port of C [vtablog](http://www.sqlite.org/cgi/src/finfo?name=ext/misc/vtablog.c)
use std::default::Default; use std::default::Default;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::os::raw::c_int; use std::os::raw::c_int;