pub struct Database { /* private fields */ }
Expand description
A thin wrapper for the Deadpool Postgres library. Used by Tusk to allocate connections for each route.
Implementations§
source§impl Database
impl Database
sourcepub async fn new(config: DatabaseConfig) -> Option<Database>
pub async fn new(config: DatabaseConfig) -> Option<Database>
Create a new database pool.
sourcepub async fn get_connection(&self) -> Result<DatabaseConnection, PoolError>
pub async fn get_connection(&self) -> Result<DatabaseConnection, PoolError>
Gets a connection within the pool.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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