Struct r2d2_sqlite::SqliteConnectionManager [−][src]
pub struct SqliteConnectionManager { /* fields omitted */ }
Expand description
An r2d2::ManageConnection
for rusqlite::Connection
s.
Implementations
Creates a new SqliteConnectionManager
from file.
See rusqlite::Connection::open
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
type Connection = Connection
type Connection = Connection
The connection type this manager deals with.
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