[−][src]Struct diesel::sqlite::SqliteConnection
Connections for the SQLite backend. Unlike other backends, "connection URLs"
for SQLite are file paths or special identifiers like :memory
.
Methods
impl SqliteConnection
[src]
impl SqliteConnection
pub fn immediate_transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
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(()) })
pub fn exclusive_transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
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
impl SimpleConnection for SqliteConnection
[src]
impl SimpleConnection for SqliteConnection
fn batch_execute(&self, query: &str) -> QueryResult<()>
[src]
fn batch_execute(&self, query: &str) -> QueryResult<()>
impl Connection for SqliteConnection
[src]
impl Connection for SqliteConnection
type Backend = Sqlite
The backend this type connects to
type TransactionManager = AnsiTransactionManager
fn establish(database_url: &str) -> ConnectionResult<Self>
[src]
fn establish(database_url: &str) -> ConnectionResult<Self>
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
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
fn begin_test_transaction(&self) -> QueryResult<()>
[src]
fn begin_test_transaction(&self) -> QueryResult<()>
Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction. Read more
fn test_transaction<T, E, F>(&self, f: F) -> T where
F: FnOnce() -> Result<T, E>,
E: Debug,
[src]
fn test_transaction<T, E, F>(&self, f: F) -> T where
F: FnOnce() -> Result<T, E>,
E: Debug,
Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. Read more
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]
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,
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
[src]
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
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]
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>,
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
[src]
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
impl<T, U, Op> ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend> for InsertStatement<T, OwnedBatchInsert<ValuesClause<U, T>>, Op> where
InsertStatement<T, ValuesClause<U, T>, Op>: QueryFragment<Sqlite>,
T: Copy,
Op: Copy,
[src]
impl<T, U, Op> ExecuteDsl<SqliteConnection, <SqliteConnection as Connection>::Backend> for InsertStatement<T, OwnedBatchInsert<ValuesClause<U, T>>, Op> where
InsertStatement<T, ValuesClause<U, T>, Op>: QueryFragment<Sqlite>,
T: Copy,
Op: Copy,
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
[src]
fn execute(query: Self, conn: &SqliteConnection) -> QueryResult<usize>
impl Send for SqliteConnection
[src]
impl Send for SqliteConnection
Auto Trait Implementations
impl !Sync for SqliteConnection
impl !Sync for SqliteConnection
Blanket Implementations
impl<T> IntoSql for T
[src]
impl<T> IntoSql for T
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
[src]
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
Convert self
to an expression for Diesel's query builder. Read more
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
[src]
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel's query builder. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T