Struct r2d2_sqlite::SqliteConnectionManager[][src]

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

An r2d2::ManageConnection for rusqlite::Connections.

Implementations

Creates a new SqliteConnectionManager from file.

See rusqlite::Connection::open

Creates a new SqliteConnectionManager from memory.

Converts SqliteConnectionManager into one that sets OpenFlags upon connection creation.

See rustqlite::OpenFlags for a list of available flags.

Converts SqliteConnectionManager into one that calls an initialization function upon connection creation. Could be used to set PRAGMAs, for example.

Example

Make a SqliteConnectionManager that sets the foreign_keys pragma to true for every connection.

let manager = SqliteConnectionManager::file("app.db")
    .with_init(|c| c.execute_batch("PRAGMA foreign_keys=1;"));

Trait Implementations

Formats the value using the given formatter. Read more

The connection type this manager deals with.

The error type returned by Connections.

Attempts to create a new connection.

Determines if the connection is still connected to the database. Read more

Quickly determines if the connection is no longer usable. Read more

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.

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.