From 41803cc3cabd9d3364ce106c35e73a4a2349cc7c Mon Sep 17 00:00:00 2001 From: Ivan Ukhov Date: Fri, 12 Jun 2015 14:34:50 -0400 Subject: [PATCH] Switch to {open, prepare, close}_v2 --- src/database.rs | 6 ++++-- src/statement.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/database.rs b/src/database.rs index 9f8325a..77b363e 100644 --- a/src/database.rs +++ b/src/database.rs @@ -17,7 +17,9 @@ impl<'l> Database<'l> { pub fn open(path: &Path) -> Result> { 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) }; } } diff --git a/src/statement.rs b/src/statement.rs index 87e1d1a..393cfaf 100644 --- a/src/statement.rs +++ b/src/statement.rs @@ -117,7 +117,8 @@ impl Value for String { pub fn new<'l>(raw1: *mut ffi::sqlite3, sql: &str) -> Result> { 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 }) }