Struct diesel::prelude::SqliteConnection[][src]

pub struct SqliteConnection { /* fields omitted */ }
Expand description

Connections for the SQLite backend. Unlike other backends, “connection URLs” for SQLite are file paths, URIs, or special identifiers like :memory:.

Implementations

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(())
})

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

The backend this type connects to

Establishes a new connection to the database Read more

Executes the given function inside of a database transaction Read more

Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction. Read more

Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. Read more

Execute this command

Execute this command

Execute multiple SQL statements within the same string. Read more

See the traits documentation.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.