[−][src]Struct c3p0_pool_sqlite::r2d2::SqliteConnectionManager
An r2d2::ManageConnection
for rusqlite::Connection
s.
Methods
impl SqliteConnectionManager
[src]
pub fn file<P>(path: P) -> SqliteConnectionManager where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Creates a new SqliteConnectionManager
from file.
See rusqlite::Connection::open
pub fn memory() -> SqliteConnectionManager
[src]
Creates a new SqliteConnectionManager
from memory.
pub fn with_flags(self, flags: OpenFlags) -> SqliteConnectionManager
[src]
Converts SqliteConnectionManager
into one that sets OpenFlags upon
connection creation.
See rustqlite::OpenFlags
for a list of available flags.
pub fn with_init<F>(self, init: F) -> SqliteConnectionManager where
F: Fn(&Connection) -> Result<(), Error> + Send + Sync + 'static,
[src]
F: Fn(&Connection) -> Result<(), Error> + Send + Sync + 'static,
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
impl ManageConnection for SqliteConnectionManager
[src]
type Connection = Connection
The connection type this manager deals with.
type Error = Error
The error type returned by Connection
s.
fn connect(&self) -> Result<Connection, Error>
[src]
fn is_valid(&self, conn: &mut Connection) -> Result<(), Error>
[src]
fn has_broken(&self, &mut Connection) -> bool
[src]
impl Debug for SqliteConnectionManager
[src]
Auto Trait Implementations
impl Send for SqliteConnectionManager
impl Unpin for SqliteConnectionManager
impl Sync for SqliteConnectionManager
impl !RefUnwindSafe for SqliteConnectionManager
impl !UnwindSafe for SqliteConnectionManager
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,