Struct sqlx_sqlite::LockedSqliteHandle

source ·
pub struct LockedSqliteHandle<'a> { /* private fields */ }

Implementations§

source§

impl LockedSqliteHandle<'_>

source

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.

source

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.

source

pub fn set_progress_handler<F>(&mut self, num_ops: i32, callback: F)
where F: FnMut() -> bool + Send + 'static,

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.

source

pub fn set_update_hook<F>(&mut self, callback: F)
where F: FnMut(UpdateHookResult<'_>) + Send + 'static,

source

pub fn remove_progress_handler(&mut self)

Removes the progress handler on a database connection. The method does nothing if no handler was set.

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more