pub struct ConfigAndPool {
pub pool: MiddlewarePool,
pub db_type: DatabaseType,
}
Expand description
Configuration and connection pool for a database
This struct holds both the configuration and the connection pool for a database, making it easier to manage database connections.
Fields§
§pool: MiddlewarePool
The connection pool
db_type: DatabaseType
The database type
Implementations§
Source§impl ConfigAndPool
impl ConfigAndPool
Sourcepub async fn new_postgres(
pg_config: PgConfig,
) -> Result<Self, SqlMiddlewareDbError>
pub async fn new_postgres( pg_config: PgConfig, ) -> Result<Self, SqlMiddlewareDbError>
Asynchronous initializer for ConfigAndPool with Postgres
Source§impl ConfigAndPool
impl ConfigAndPool
Sourcepub async fn new_sqlite(db_path: String) -> Result<Self, SqlMiddlewareDbError>
pub async fn new_sqlite(db_path: String) -> Result<Self, SqlMiddlewareDbError>
Asynchronous initializer for ConfigAndPool with Sqlite using deadpool_sqlite
Trait Implementations§
Source§impl Clone for ConfigAndPool
impl Clone for ConfigAndPool
Source§fn clone(&self) -> ConfigAndPool
fn clone(&self) -> ConfigAndPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ConfigAndPool
impl !RefUnwindSafe for ConfigAndPool
impl Send for ConfigAndPool
impl Sync for ConfigAndPool
impl Unpin for ConfigAndPool
impl !UnwindSafe for ConfigAndPool
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