2025-08-29 20:43:36 -04:00
|
|
|
//! Dioxus components that will display a Tavern blogging system Blog.
|
|
|
|
|
|
|
|
|
|
mod info;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-04 12:44:51 -04:00
|
|
|
#[cfg(feature = "server")]
|
2025-09-02 14:00:19 -04:00
|
|
|
use tavern::Database;
|
|
|
|
|
|
2025-08-29 20:43:36 -04:00
|
|
|
pub use crate::info::{get_name, get_version};
|
2025-09-02 14:00:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-04 12:44:51 -04:00
|
|
|
#[cfg(feature = "server")]
|
2025-09-02 14:00:19 -04:00
|
|
|
pub async fn init_database<P>(path: P)
|
|
|
|
|
-> Result<std::sync::Arc<Database>, Box<dyn std::error::Error>>
|
|
|
|
|
where P: AsRef<std::path::Path>
|
|
|
|
|
{
|
|
|
|
|
let db = Database::open(path).await?;
|
|
|
|
|
Ok(std::sync::Arc::new(db))
|
|
|
|
|
}
|