Skip to main content

FromPoolConfig

Trait FromPoolConfig 

Source
pub trait FromPoolConfig: DatabaseAdapter + Sized {
    // Required method
    fn from_pool_config<'life0, 'async_trait>(
        config: &'life0 TenantPoolConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for database adapters that can be created from a connection string.

Implemented by adapters that support dynamic pool creation at runtime (as opposed to static initialization at server startup).

Required Methods§

Source

fn from_pool_config<'life0, 'async_trait>( config: &'life0 TenantPoolConfig, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new adapter from connection configuration.

§Errors

Returns FraiseQLError::ConnectionPool or FraiseQLError::Database if the connection cannot be established.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§