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§
Sourcefn 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,
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".
Implementations on Foreign Types§
Source§impl FromPoolConfig for PostgresAdapter
impl FromPoolConfig for PostgresAdapter
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,
Source§impl<A: FromPoolConfig> FromPoolConfig for CachedDatabaseAdapter<A>
The binary’s Server wraps its adapter in a CachedDatabaseAdapter, so the
per-tenant executor registry stores Executor<CachedDatabaseAdapter<A>> and the
factory must build that wrapped type. Each tenant gets its own fresh, isolated
QueryResultCache; on a schema update the whole executor is replaced
(TenantExecutorRegistry::upsert), so the cache is rebuilt rather than
version-invalidated — an empty schema_version namespace is sufficient and
collision-free. Per-tenant caches use CacheConfig::default() (they do not
inherit the server’s tuned view-TTL / cacheable-view configuration).
impl<A: FromPoolConfig> FromPoolConfig for CachedDatabaseAdapter<A>
The binary’s Server wraps its adapter in a CachedDatabaseAdapter, so the
per-tenant executor registry stores Executor<CachedDatabaseAdapter<A>> and the
factory must build that wrapped type. Each tenant gets its own fresh, isolated
QueryResultCache; on a schema update the whole executor is replaced
(TenantExecutorRegistry::upsert), so the cache is rebuilt rather than
version-invalidated — an empty schema_version namespace is sufficient and
collision-free. Per-tenant caches use CacheConfig::default() (they do not
inherit the server’s tuned view-TTL / cacheable-view configuration).