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.
pub fn set_update_hook<F>(&mut self, callback: F)
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.
pub fn remove_update_hook(&mut self)
Auto Trait Implementations§
impl<'a> Freeze for LockedSqliteHandle<'a>
impl<'a> !RefUnwindSafe for LockedSqliteHandle<'a>
impl<'a> Send for LockedSqliteHandle<'a>
impl<'a> !Sync for LockedSqliteHandle<'a>
impl<'a> Unpin for LockedSqliteHandle<'a>
impl<'a> !UnwindSafe for LockedSqliteHandle<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more