fusion-db 0.1.0

A data fusion platform with scheduler, ai agent studio and core libraries
Documentation
use fusion_core::component::Component;
use fusion_core::{application::Application, component::ComponentArc};
use fusion_db::DbPlugin;
use fusionsql::ModelManager;
use log::info;

#[derive(Clone, Component)]
struct TestSvc {
  #[component]
  mm: ModelManager,
}

impl TestSvc {
  pub async fn test(&self) -> fusion_core::Result<String> {
    let _mm = &self.mm;
    Ok(String::from("test service"))
  }
}

#[tokio::main]
async fn main() {
  // logforth::starter_log::stdout().apply();

  let mut ab = Application::builder();
  ab.add_plugin(DbPlugin);
  ab.run().await.unwrap();
  let app = Application::global();
  let mm: ComponentArc<ModelManager> = app.get_component_arc().unwrap();

  let addr: *const ModelManager = &*mm;
  info!("Memory address of ModelManager: {:p}", addr);

  let test_svc = app.get_component_arc::<TestSvc>().unwrap();
  let ret = test_svc.test().await.unwrap();
  assert_eq!(ret, "test service");
}