mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-15 06:20:50 +00:00
Switch to {open, prepare, close}_v2
This commit is contained in:
parent
40e08d5b97
commit
41803cc3ca
@ -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) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 })
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user