use std::fmt;
use std::sync::Arc;

use crate::config::SysConfig;
use crate::db::TemplateDb;

pub type TemplateDbType = Arc<dyn TemplateDb + Send + Sync>;

pub struct AppState {
    pub log_level: u8,
    pub config_path: Option<String>,
    pub db_path: String,
    pub sys_config: SysConfig,
    pub local_db: TemplateDbType,
}

impl fmt::Debug for AppState {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "AppState {{ local_db, sys_config, log_level, ... }}")
    }
}
