mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-01 22:38:55 +08:00
Merge remote-tracking branch 'jgallagher/master' into vtab
This commit is contained in:
14
src/lib.rs
14
src/lib.rs
@@ -309,7 +309,7 @@ impl Connection {
|
||||
///
|
||||
/// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the
|
||||
/// underlying SQLite call fails.
|
||||
pub fn execute(&self, sql: &str, params: &[&ToSql]) -> Result<c_int> {
|
||||
pub fn execute(&self, sql: &str, params: &[&ToSql]) -> Result<usize> {
|
||||
self.prepare(sql)
|
||||
.and_then(|mut stmt| stmt.execute(params))
|
||||
}
|
||||
@@ -323,7 +323,7 @@ impl Connection {
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// # use rusqlite::{Connection, Result};
|
||||
/// fn insert(conn: &Connection) -> Result<i32> {
|
||||
/// fn insert(conn: &Connection) -> Result<usize> {
|
||||
/// conn.execute_named("INSERT INTO test (name) VALUES (:name)", &[(":name", &"one")])
|
||||
/// }
|
||||
/// ```
|
||||
@@ -332,7 +332,7 @@ impl Connection {
|
||||
///
|
||||
/// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the
|
||||
/// underlying SQLite call fails.
|
||||
pub fn execute_named(&self, sql: &str, params: &[(&str, &ToSql)]) -> Result<c_int> {
|
||||
pub fn execute_named(&self, sql: &str, params: &[(&str, &ToSql)]) -> Result<usize> {
|
||||
self.prepare(sql)
|
||||
.and_then(|mut stmt| stmt.execute_named(params))
|
||||
}
|
||||
@@ -574,7 +574,7 @@ impl Connection {
|
||||
self.db.borrow_mut().decode_result(code)
|
||||
}
|
||||
|
||||
fn changes(&self) -> c_int {
|
||||
fn changes(&self) -> usize {
|
||||
self.db.borrow_mut().changes()
|
||||
}
|
||||
|
||||
@@ -915,8 +915,8 @@ impl InnerConnection {
|
||||
})
|
||||
}
|
||||
|
||||
fn changes(&mut self) -> c_int {
|
||||
unsafe { ffi::sqlite3_changes(self.db()) }
|
||||
fn changes(&mut self) -> usize {
|
||||
unsafe { ffi::sqlite3_changes(self.db()) as usize }
|
||||
}
|
||||
|
||||
fn is_autocommit(&self) -> bool {
|
||||
@@ -935,7 +935,7 @@ impl InnerConnection {
|
||||
stmt = ffi::sqlite3_next_stmt(db, stmt);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "hooks"))]
|
||||
|
||||
Reference in New Issue
Block a user