mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
commit
18b8c390ab
@ -713,10 +713,13 @@ mod test {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let res: bool = db.query_row(
|
let res: bool = db
|
||||||
|
.query_row(
|
||||||
"SELECT example(0, i) FROM (SELECT 0 as i UNION SELECT 1)",
|
"SELECT example(0, i) FROM (SELECT 0 as i UNION SELECT 1)",
|
||||||
NO_PARAMS,
|
NO_PARAMS,
|
||||||
|r| r.get(0)).unwrap();
|
|r| r.get(0),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
// Doesn't actually matter, we'll assert in the function if there's a problem.
|
// Doesn't actually matter, we'll assert in the function if there's a problem.
|
||||||
assert!(res);
|
assert!(res);
|
||||||
}
|
}
|
||||||
|
12
src/lib.rs
12
src/lib.rs
@ -196,7 +196,12 @@ pub enum DatabaseName<'a> {
|
|||||||
|
|
||||||
// Currently DatabaseName is only used by the backup and blob mods, so hide
|
// Currently DatabaseName is only used by the backup and blob mods, so hide
|
||||||
// this (private) impl to avoid dead code warnings.
|
// this (private) impl to avoid dead code warnings.
|
||||||
#[cfg(any(feature = "backup", feature = "blob", feature = "session", feature = "bundled"))]
|
#[cfg(any(
|
||||||
|
feature = "backup",
|
||||||
|
feature = "blob",
|
||||||
|
feature = "session",
|
||||||
|
feature = "bundled"
|
||||||
|
))]
|
||||||
impl<'a> DatabaseName<'a> {
|
impl<'a> DatabaseName<'a> {
|
||||||
fn to_cstring(&self) -> Result<CString> {
|
fn to_cstring(&self) -> Result<CString> {
|
||||||
use self::DatabaseName::{Attached, Main, Temp};
|
use self::DatabaseName::{Attached, Main, Temp};
|
||||||
@ -618,7 +623,10 @@ impl Connection {
|
|||||||
self.db.borrow_mut().decode_result(code)
|
self.db.borrow_mut().decode_result(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn changes(&self) -> usize {
|
/// Return the number of rows modified, inserted or deleted by the most
|
||||||
|
/// recently completed INSERT, UPDATE or DELETE statement on the database
|
||||||
|
/// connection.
|
||||||
|
pub fn changes(&self) -> usize {
|
||||||
self.db.borrow_mut().changes()
|
self.db.borrow_mut().changes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user