Initial Bard library commit.
This was added to test the database into server context pipeline.
This commit is contained in:
@ -4,4 +4,16 @@ mod info;
|
||||
|
||||
|
||||
|
||||
use tavern::Database;
|
||||
|
||||
pub use crate::info::{get_name, get_version};
|
||||
|
||||
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user