pub fn new<T, B>(database_url: String) -> Result<std::sync::Arc<dyn crate::auth::AuthProvider>, String>
where
  T: 'static + diesel::Connection<Backend = B, TransactionManager = diesel::connection::AnsiTransactionManager>,
  B: 'static + diesel::backend::Backend<RawValue = [u8]> + diesel::backend::UsesAnsiSavepointSyntax,
  B::QueryBuilder: Default + diesel::query_builder::QueryBuilder<B>,
  bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, B>,
{
  let manager = diesel::r2d2::ConnectionManager::<T>::new(database_url);
  Ok(std::sync::Arc::new(PhpBBDb {
    connection: diesel::r2d2::Pool::builder().build(manager).map_err(|e| format!("Failed to create phpBB database connection: {}", e))?,
  }))
}
/// Create a phpBB-backed store
Create a phpBB-backed store
Create a phpBB - backed store
pub fn new<T, B>(database_url: String) -> Result<std::sync::Arc<dyn crate::auth::AuthProvider>, String>
where
  T: 'static + diesel::Connection<Backend = B, TransactionManager = diesel::connection::AnsiTransactionManager>,
  B: 'static + diesel::backend::Backend<RawValue = [u8]> + diesel::backend::UsesAnsiSavepointSyntax,
  B::QueryBuilder: Default + diesel::query_builder::QueryBuilder<B>,
  bool: diesel::deserialize::FromSql<diesel::sql_types::Bool, B>,
{
  let manager = diesel::r2d2::ConnectionManager::<T>::new(database_url);
  Ok(std::sync::Arc::new(PhpBBDb {
    connection: diesel::r2d2::Pool::builder().build(manager).map_err(|e| format!("Failed to create phpBB database connection: {}", e))?,
  }))
}
pub fn new < T , B > ( database_url : String ) -> Result < std :: sync :: Arc < dyn crate :: auth :: AuthProvider > , String > where T : ' static + diesel :: Connection < Backend = B , TransactionManager = diesel :: connection :: AnsiTransactionManager > , B : ' static + diesel :: backend :: Backend < RawValue = [ u8 ] > + diesel :: backend :: UsesAnsiSavepointSyntax , B :: QueryBuilder : Default + diesel :: query_builder :: QueryBuilder < B > , bool : diesel :: deserialize :: FromSql < diesel :: sql_types :: Bool , B > , { let manager = diesel :: r2d2 :: ConnectionManager :: < T > :: new ( database_url ) ; Ok ( std :: sync :: Arc :: new ( PhpBBDb { connection : diesel :: r2d2 :: Pool :: builder ( ) . build ( manager ) . map_err ( | e | format ! ( " " e ) ) ? , } ) ) }
Create a phpBB-backed store
Create a phpBB - backed store
database_url
String
database_url
String