Struct git_icons::database::SqliteConnection
source · pub struct SqliteConnection { /* private fields */ }Expand description
Connections for the SQLite backend. Unlike other backends, “connection URLs”
for SQLite are file paths, URIs, or special
identifiers like :memory:.
Implementations
sourceimpl SqliteConnection
impl SqliteConnection
sourcepub fn immediate_transaction<T, E, F>(&self, f: F) -> Result<T, E>where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
pub fn immediate_transaction<T, E, F>(&self, f: F) -> Result<T, E>where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
Run a transaction with BEGIN IMMEDIATE
This method will return an error if a transaction is already open.
Example
conn.immediate_transaction(|| {
// Do stuff in a transaction
Ok(())
})sourcepub fn exclusive_transaction<T, E, F>(&self, f: F) -> Result<T, E>where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
pub fn exclusive_transaction<T, E, F>(&self, f: F) -> Result<T, E>where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
Run a transaction with BEGIN EXCLUSIVE
This method will return an error if a transaction is already open.
Example
conn.exclusive_transaction(|| {
// Do stuff in a transaction
Ok(())
})Trait Implementations
sourceimpl Connection for SqliteConnection
impl Connection for SqliteConnection
sourcefn establish(database_url: &str) -> Result<SqliteConnection, ConnectionError>
fn establish(database_url: &str) -> Result<SqliteConnection, ConnectionError>
Establishes a new connection to the database Read more
sourcefn transaction<T, E, F>(&self, f: F) -> Result<T, E>where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
fn transaction<T, E, F>(&self, f: F) -> Result<T, E>where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
Executes the given function inside of a database transaction Read more
sourceimpl SimpleConnection for SqliteConnection
impl SimpleConnection for SqliteConnection
sourceimpl<Changes, Output> UpdateAndFetchResults<Changes, Output> for SqliteConnectionwhere
Changes: Copy + Identifiable + AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget,
<Changes as HasTable>::Table: FindDsl<<Changes as Identifiable>::Id>,
UpdateStatement<<Changes as HasTable>::Table, <Changes as IntoUpdateTarget>::WhereClause, <Changes as AsChangeset>::Changeset, NoReturningClause>: ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend>,
<<Changes as HasTable>::Table as FindDsl<<Changes as Identifiable>::Id>>::Output: LoadQuery<SqliteConnection, Output>,
impl<Changes, Output> UpdateAndFetchResults<Changes, Output> for SqliteConnectionwhere
Changes: Copy + Identifiable + AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget,
<Changes as HasTable>::Table: FindDsl<<Changes as Identifiable>::Id>,
UpdateStatement<<Changes as HasTable>::Table, <Changes as IntoUpdateTarget>::WhereClause, <Changes as AsChangeset>::Changeset, NoReturningClause>: ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend>,
<<Changes as HasTable>::Table as FindDsl<<Changes as Identifiable>::Id>>::Output: LoadQuery<SqliteConnection, Output>,
sourcefn update_and_fetch(&self, changeset: Changes) -> Result<Output, Error>
fn update_and_fetch(&self, changeset: Changes) -> Result<Output, Error>
See the traits documentation.
impl Send for SqliteConnection
Auto Trait Implementations
impl !RefUnwindSafe for SqliteConnection
impl !Sync for SqliteConnection
impl Unpin for SqliteConnection
impl UnwindSafe for SqliteConnection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
Convert
self to an expression for Diesel’s query builder. Read moresourcefn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more