Skip to main content

Connection

Struct Connection 

Source
pub struct Connection { /* private fields */ }
Expand description

Database connection.

Implementations§

Source§

impl Connection

Source

pub fn open<P: SqliteStr>(path: P) -> Result<Self>

Open a database connection with default flag.

See OpenFlag for the default value.

Source

pub fn open_in_memory() -> Result<Self>

Open in memory database.

Source

pub fn open_with<P: SqliteStr>(path: P, flags: OpenFlag) -> Result<Self>

Open a database connection with given flag.

Trait Implementations§

Source§

impl Database for Connection

Source§

impl Debug for Connection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'s> Execute<'s> for &'s mut Connection

Source§

fn prepare<S: SqliteStr>(self, sql: S) -> Result<StatementRef<'s>>

Source§

impl Send for Connection

SAFETY: Checked that sqlite compiled with SERIALIZE_MODE thus synchronization is handled by sqlite

Source§

impl Sync for Connection

SAFETY: Checked that sqlite compiled with SERIALIZE_MODE thus synchronization is handled by sqlite

Auto Trait Implementations§

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> DatabaseExt for T
where T: Database,

Source§

fn last_insert_rowid(&self) -> i64

returns the rowid of the most recent successful INSERT into a rowid table or virtual table on database connection Read more
Source§

fn mutex_enter(&self) -> SqliteMutexGuard

attempt to enter a mutex, if another thread is already within the mutex, this call will block Read more
Source§

fn busy_timeout( &mut self, timeout: impl Into<Duration>, ) -> Result<(), ConfigureError>

This routine sets a busy handler that sleeps for a specified amount of time when a table is locked. Read more
Source§

fn extended_result_codes(&mut self, onoff: bool) -> Result<(), ConfigureError>

enables or disables the extended result codes feature of SQLite. Read more
Source§

fn errmsg(&self) -> Option<&str>

return recent error’s English-language text that describes the error, as either UTF-8 or UTF-16 respectively, or NULL if no error message is available Read more
Source§

fn errstr(code: i32) -> Option<&'static str>

returns English-language text that describes the result code E, as UTF-8, or NULL if E is not an result code for which a text error message is available. Read more
Source§

fn extended_errcode(&self) -> i32

returns extended result code for recent error Read more
Source§

fn close(&self) -> Result<(), DatabaseError>

Close the database. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.