Skip to main content

nova_boot_graphdb/
plugin.rs

1use crate::NovaGraphDb;
2use nova_boot::{NovaPlugin, async_trait as nova_async_trait, axum::Extension, axum::Router};
3
4/// Plugin wiring for graph database support.
5///
6/// `NovaGraphDb` implements `NovaPlugin` so it can be registered with
7/// `NovaApp`. The plugin injects a cloned `NovaGraphDb` into request
8/// extensions to enable the `NovaGraph` extractor in handlers.
9#[nova_async_trait]
10impl NovaPlugin for NovaGraphDb {
11    fn name(&self) -> &'static str {
12        "NovaGraphDb"
13    }
14
15    async fn on_init(&self) {
16        println!("🕸️ Initializing GraphDB Plugin...");
17    }
18
19    fn extend_router(&self, router: Router<()>) -> Router<()> {
20        router.layer(Extension(self.clone()))
21    }
22}