add: move database drivers to oiseau
This commit is contained in:
parent
40fce4bc77
commit
81036e3733
57 changed files with 638 additions and 1106 deletions
|
@ -1,7 +1,22 @@
|
|||
pub mod common;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use tetratto_l10n::{read_langs, LangFile};
|
||||
|
||||
#[cfg(feature = "sqlite")]
|
||||
pub mod sqlite;
|
||||
use oiseau::sqlite::{DataManager as OiseauManager, Result};
|
||||
|
||||
#[cfg(feature = "postgres")]
|
||||
pub mod postgres;
|
||||
use oiseau::postgres::{DataManager as OiseauManager, Result};
|
||||
|
||||
use crate::config::Config;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DataManager(pub OiseauManager<Config>, pub HashMap<String, LangFile>);
|
||||
|
||||
impl DataManager {
|
||||
/// Create a new [`DataManager`].
|
||||
pub async fn new(config: Config) -> Result<Self> {
|
||||
Ok(Self(OiseauManager::new(config).await?, read_langs()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue