mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 12:42:18 +08:00
Merge branch 'stmt-cache' of https://github.com/gwenn/rusqlite into gwenn-stmt-cache
This commit is contained in:
16
src/lib.rs
16
src/lib.rs
@@ -87,6 +87,7 @@ mod error;
|
||||
#[cfg(feature = "load_extension")]mod load_extension_guard;
|
||||
#[cfg(feature = "trace")]pub mod trace;
|
||||
#[cfg(feature = "backup")]pub mod backup;
|
||||
#[cfg(feature = "cache")] pub mod cache;
|
||||
#[cfg(feature = "functions")] pub mod functions;
|
||||
#[cfg(feature = "blob")] pub mod blob;
|
||||
|
||||
@@ -912,6 +913,21 @@ impl<'conn> Statement<'conn> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "cache")]
|
||||
fn clear_bindings(&mut self) {
|
||||
unsafe {
|
||||
ffi::sqlite3_clear_bindings(self.stmt);
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(feature = "cache")]
|
||||
fn eq(&self, sql: &str) -> bool {
|
||||
unsafe {
|
||||
let c_slice = CStr::from_ptr(ffi::sqlite3_sql(self.stmt)).to_bytes();
|
||||
str::from_utf8(c_slice).unwrap().eq(sql)
|
||||
}
|
||||
}
|
||||
|
||||
fn finalize_(&mut self) -> Result<()> {
|
||||
let r = unsafe { ffi::sqlite3_finalize(self.stmt) };
|
||||
self.stmt = ptr::null_mut();
|
||||
|
Reference in New Issue
Block a user