Switch to {open, prepare, close}_v2

This commit is contained in:
Ivan Ukhov 2015-06-12 14:34:50 -04:00
parent 40e08d5b97
commit 41803cc3ca
2 changed files with 6 additions and 3 deletions

View File

@ -17,7 +17,9 @@ impl<'l> Database<'l> {
pub fn open(path: &Path) -> Result<Database<'l>> {
let mut raw = 0 as *mut _;
unsafe {
success!(ffi::sqlite3_open(path_to_c_str!(path), &mut raw));
success!(ffi::sqlite3_open_v2(path_to_c_str!(path), &mut raw,
ffi::SQLITE_OPEN_CREATE | ffi::SQLITE_OPEN_READWRITE,
0 as *const _));
}
Ok(Database {
raw: raw,
@ -101,7 +103,7 @@ impl<'l> Drop for Database<'l> {
#[allow(unused_must_use)]
fn drop(&mut self) {
self.remove_busy_handler();
unsafe { ffi::sqlite3_close(self.raw) };
unsafe { ffi::sqlite3_close_v2(self.raw) };
}
}

View File

@ -117,7 +117,8 @@ impl Value for String {
pub fn new<'l>(raw1: *mut ffi::sqlite3, sql: &str) -> Result<Statement<'l>> {
let mut raw0 = 0 as *mut _;
unsafe {
success!(raw1, ffi::sqlite3_prepare(raw1, str_to_c_str!(sql), -1, &mut raw0, 0 as *mut _));
success!(raw1, ffi::sqlite3_prepare_v2(raw1, str_to_c_str!(sql), -1, &mut raw0,
0 as *mut _));
}
Ok(Statement { raw: (raw0, raw1), phantom: PhantomData })
}