feature: add new mikan scrapers
This commit is contained in:
@@ -9,8 +9,15 @@ use sea_orm_migration::MigratorTrait;
|
||||
use super::DatabaseConfig;
|
||||
use crate::{errors::RecorderResult, migrations::Migrator};
|
||||
|
||||
pub trait DatabaseServiceConnectionTrait {
|
||||
fn get_database_connection(&self) -> &DatabaseConnection;
|
||||
}
|
||||
|
||||
pub struct DatabaseService {
|
||||
connection: DatabaseConnection,
|
||||
#[cfg(all(test, feature = "testcontainers"))]
|
||||
pub container:
|
||||
Option<testcontainers::ContainerAsync<testcontainers_modules::postgres::Postgres>>,
|
||||
}
|
||||
|
||||
impl DatabaseService {
|
||||
@@ -48,7 +55,11 @@ impl DatabaseService {
|
||||
Migrator::up(&db, None).await?;
|
||||
}
|
||||
|
||||
Ok(Self { connection: db })
|
||||
Ok(Self {
|
||||
connection: db,
|
||||
#[cfg(all(test, feature = "testcontainers"))]
|
||||
container: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user