Struct sqlx_sqlite::LockedSqliteHandle
source · pub struct LockedSqliteHandle<'a> { /* private fields */ }
Implementations§
source§impl LockedSqliteHandle<'_>
impl LockedSqliteHandle<'_>
sourcepub fn as_raw_handle(&mut self) -> NonNull<sqlite3>
pub fn as_raw_handle(&mut self) -> NonNull<sqlite3>
Returns the underlying sqlite3* connection handle.
As long as this LockedSqliteHandle
exists, it is guaranteed that the background thread
is not making FFI calls on this database handle or any of its statements.
§Note: The sqlite3
type is semver-exempt.
This API exposes the sqlite3
type from libsqlite3-sys
crate for type safety.
However, we reserve the right to upgrade libsqlite3-sys
as necessary.
Thus, if you are making direct calls via libsqlite3-sys
you should pin the version
of SQLx that you’re using, and upgrade it and libsqlite3-sys
manually as new
versions are released.
See the driver root docs for details.
sourcepub fn create_collation(
&mut self,
name: &str,
compare: impl Fn(&str, &str) -> Ordering + Send + Sync + 'static
) -> Result<(), Error>
pub fn create_collation( &mut self, name: &str, compare: impl Fn(&str, &str) -> Ordering + Send + Sync + 'static ) -> Result<(), Error>
Apply a collation to the open database.
See SqliteConnectOptions::collation()
for details.
sourcepub fn set_progress_handler<F>(&mut self, num_ops: i32, callback: F)
pub fn set_progress_handler<F>(&mut self, num_ops: i32, callback: F)
Sets a progress handler that is invoked periodically during long running calls. If the progress callback
returns false
, then the operation is interrupted.
num_ops
is the approximate number of virtual machine instructions
that are evaluated between successive invocations of the callback. If num_ops
is less than one then the
progress handler is disabled.
Only a single progress handler may be defined at one time per database connection; setting a new progress handler cancels the old one.
The progress handler callback must not do anything that will modify the database connection that invoked the progress handler. Note that sqlite3_prepare_v2() and sqlite3_step() both modify their database connections in this context.
sourcepub fn remove_progress_handler(&mut self)
pub fn remove_progress_handler(&mut self)
Removes the progress handler on a database connection. The method does nothing if no handler was set.