pub struct DuckDbConnectionManager { /* private fields */ }Expand description
An r2d2::ManageConnection that creates connections from a shared Database.
Implementations§
Source§impl DuckDbConnectionManager
impl DuckDbConnectionManager
Sourcepub fn new(database: Database) -> DuckDbConnectionManager
pub fn new(database: Database) -> DuckDbConnectionManager
Creates a manager over an already-open Database.
Sourcepub fn file<P: AsRef<Path>>(path: P) -> Result<DuckDbConnectionManager>
pub fn file<P: AsRef<Path>>(path: P) -> Result<DuckDbConnectionManager>
Creates a manager backed by a file-based database.
§Errors
Returns an error if the database cannot be opened.
Sourcepub fn file_with_flags<P: AsRef<Path>>(
path: P,
config: Config,
) -> Result<DuckDbConnectionManager>
pub fn file_with_flags<P: AsRef<Path>>( path: P, config: Config, ) -> Result<DuckDbConnectionManager>
Creates a manager backed by a file-based database with additional config.
§Errors
Returns an error if the database cannot be opened.
Sourcepub fn memory() -> Result<DuckDbConnectionManager>
pub fn memory() -> Result<DuckDbConnectionManager>
Creates a manager backed by a shared in-memory database.
All connections checked out of a pool built from this manager observe the same in-memory data.
§Errors
Returns an error if the database cannot be opened.
Sourcepub fn memory_with_flags(config: Config) -> Result<DuckDbConnectionManager>
pub fn memory_with_flags(config: Config) -> Result<DuckDbConnectionManager>
Creates a manager backed by a shared in-memory database with additional config.
§Errors
Returns an error if the database cannot be opened.
Trait Implementations§
Source§impl Clone for DuckDbConnectionManager
impl Clone for DuckDbConnectionManager
Source§fn clone(&self) -> DuckDbConnectionManager
fn clone(&self) -> DuckDbConnectionManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DuckDbConnectionManager
impl Debug for DuckDbConnectionManager
Source§impl ManageConnection for DuckDbConnectionManager
impl ManageConnection for DuckDbConnectionManager
Source§type Connection = Connection
type Connection = Connection
The connection type this manager deals with.
Source§fn is_valid(&self, conn: &mut Connection) -> Result<(), Error>
fn is_valid(&self, conn: &mut Connection) -> Result<(), Error>
Determines if the connection is still connected to the database. Read more
Source§fn has_broken(&self, conn: &mut Connection) -> bool
fn has_broken(&self, conn: &mut Connection) -> bool
Quickly determines if the connection is no longer usable. Read more
Auto Trait Implementations§
impl Freeze for DuckDbConnectionManager
impl RefUnwindSafe for DuckDbConnectionManager
impl Send for DuckDbConnectionManager
impl Sync for DuckDbConnectionManager
impl Unpin for DuckDbConnectionManager
impl UnsafeUnpin for DuckDbConnectionManager
impl UnwindSafe for DuckDbConnectionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more