mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-29 21:52:12 +08:00
Merge pull request #99 from gwenn/simple-exec
Simplify execute_batch implementation.
This commit is contained in:
commit
699141df22
@ -658,13 +658,12 @@ impl InnerConnection {
|
|||||||
fn execute_batch(&mut self, sql: &str) -> Result<()> {
|
fn execute_batch(&mut self, sql: &str) -> Result<()> {
|
||||||
let c_sql = try!(str_to_cstring(sql));
|
let c_sql = try!(str_to_cstring(sql));
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut errmsg: *mut c_char = mem::uninitialized();
|
|
||||||
let r = ffi::sqlite3_exec(self.db(),
|
let r = ffi::sqlite3_exec(self.db(),
|
||||||
c_sql.as_ptr(),
|
c_sql.as_ptr(),
|
||||||
None,
|
None,
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
&mut errmsg);
|
ptr::null_mut());
|
||||||
self.decode_result_with_errmsg(r, errmsg)
|
self.decode_result(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user