Merge pull request #1268 from gwenn/clear_bindings

Add Statement::clear_bindings
This commit is contained in:
gwenn 2022-12-11 10:47:31 +01:00 committed by GitHub
commit 9644432135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -169,8 +169,10 @@ impl RawStatement {
}
#[inline]
pub fn clear_bindings(&self) -> c_int {
unsafe { ffi::sqlite3_clear_bindings(self.ptr) }
pub fn clear_bindings(&self) {
unsafe {
ffi::sqlite3_clear_bindings(self.ptr);
} // rc is always SQLITE_OK
}
#[inline]

View File

@ -870,6 +870,11 @@ impl Statement<'_> {
mem::swap(&mut stmt, &mut self.stmt);
stmt
}
/// Reset all bindings
pub fn clear_bindings(&mut self) {
self.stmt.clear_bindings()
}
}
impl fmt::Debug for Statement<'_> {