mod canonical;
mod conversions;
mod legacy_sync;
mod repository_impl;
use sea_orm::DbBackend;
use std::sync::Arc;
use super::types::{DatabaseBackendType, SeaOrmDatabase};
pub struct SeaOrmTeamRepository {
db: Arc<SeaOrmDatabase>,
}
impl SeaOrmTeamRepository {
pub fn new(db: Arc<SeaOrmDatabase>) -> Self {
Self { db }
}
pub(super) fn backend(&self) -> DbBackend {
match self.db.backend_type {
DatabaseBackendType::PostgreSQL => DbBackend::Postgres,
DatabaseBackendType::SQLite => DbBackend::Sqlite,
}
}
pub(super) fn ph(&self, n: usize) -> String {
match self.db.backend_type {
DatabaseBackendType::PostgreSQL => format!("${}", n),
DatabaseBackendType::SQLite => "?".to_string(),
}
}
}