|
|
|
@ -73,7 +73,21 @@ impl AnalyticUnitService {
|
|
|
|
|
Ok(()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn get_active() { |
|
|
|
|
pub fn get_active(&self) -> anyhow::Result<Box<dyn types::AnalyticUnit + Send + Sync>> { |
|
|
|
|
let conn = self.connection.lock().unwrap(); |
|
|
|
|
let stmt = conn.prepare( |
|
|
|
|
"SELECT id, type, config from analytic_unit WHERE active = TRUE" |
|
|
|
|
)?; |
|
|
|
|
|
|
|
|
|
// stmt.query_row([], |row| {
|
|
|
|
|
|
|
|
|
|
// // resolve_au()
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// TODO: use serde to deserialise config
|
|
|
|
|
|
|
|
|
|
return Err(anyhow::format_err!("bot implemented")); |
|
|
|
|
|
|
|
|
|
// TODO: query by id
|
|
|
|
|
// TODO: deserialisation of analytic_unit by config and it's type
|
|
|
|
|
} |
|
|
|
|