[−][src]Struct diesel::sqlite::SqliteConnection
Connections for the SQLite backend. Unlike other backends, "connection URLs"
for SQLite are file paths, URIs, or special
identifiers like :memory:
.
Methods
impl SqliteConnection
[src]
pub fn immediate_transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
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(()) })
pub fn exclusive_transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
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
impl Connection for SqliteConnection
[src]
type Backend = Sqlite
The backend this type connects to
type TransactionManager = AnsiTransactionManager
fn establish(database_url: &str) -> ConnectionResult<Self>
[src]
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
F: FnOnce() -> Result<T, E>,
E: From<Error>,
fn begin_test_transaction(&self) -> QueryResult<()>
[src]
fn test_transaction<T, E, F>(&self, f: F) -> T where
F: FnOnce() -> Result<T, E>,
E: Debug,
[src]
F: FnOnce() -> Result<T, E>,
E: Debug,
impl<'a, T, U, Op> ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend> for InsertStatement<T, &'a [U], Op> where
&'a U: Insertable<T>,
InsertStatement<T, <&'a U as Insertable<T>>::Values, Op>: QueryFragment<Sqlite>,
T: Copy,
Op: Copy,
[src]
&'a U: Insertable<T>,
InsertStatement<T, <&'a U as Insertable<T>>::Values, Op>: QueryFragment<Sqlite>,
T: Copy,
Op: Copy,
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
[src]
impl<'a, T, U, Op> ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend> for InsertStatement<T, BatchInsert<'a, U, T>, Op> where
InsertStatement<T, &'a [U], Op>: ExecuteDsl<SqliteConnection>,
[src]
InsertStatement<T, &'a [U], Op>: ExecuteDsl<SqliteConnection>,
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
[src]
impl<T, U, Op> ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend> for InsertStatement<T, OwnedBatchInsert<ValuesClause<U, T>, T>, Op> where
InsertStatement<T, ValuesClause<U, T>, Op>: QueryFragment<Sqlite>,
T: Copy,
Op: Copy,
[src]
InsertStatement<T, ValuesClause<U, T>, Op>: QueryFragment<Sqlite>,
T: Copy,
Op: Copy,
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
[src]
impl Send for SqliteConnection
[src]
impl SimpleConnection for SqliteConnection
[src]
fn batch_execute(&self, query: &str) -> QueryResult<()>
[src]
impl<Changes, Output> UpdateAndFetchResults<Changes, Output> for SqliteConnection where
Changes: Copy + Identifiable,
Changes: AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget,
Changes::Table: FindDsl<Changes::Id>,
Update<Changes, Changes>: ExecuteDsl<SqliteConnection>,
Find<Changes::Table, Changes::Id>: LoadQuery<SqliteConnection, Output>,
[src]
Changes: Copy + Identifiable,
Changes: AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget,
Changes::Table: FindDsl<Changes::Id>,
Update<Changes, Changes>: ExecuteDsl<SqliteConnection>,
Find<Changes::Table, Changes::Id>: LoadQuery<SqliteConnection, Output>,
fn update_and_fetch(&self, changeset: Changes) -> QueryResult<Output>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SqliteConnection
impl !Sync for SqliteConnection
impl Unpin for SqliteConnection
impl UnwindSafe for SqliteConnection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
[src]
Self: AsExpression<T> + Sized,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,