chore: simplify

This commit is contained in:
itsscb 2025-05-26 20:44:32 +02:00
parent 8d8857cace
commit ff090c9d68

View File

@ -22,11 +22,7 @@ pub async fn open<T: AsRef<str>>(path: T) -> Result<SqlitePool, String> {
pub async fn new<T: AsRef<str>>(path: T) -> Result<SqlitePool, String> {
std::fs::File::create_new(path.as_ref()).map_err(|e| e.to_string())?;
let db_url = format!("sqlite://{}", path.as_ref());
SqlitePool::connect(&db_url)
.await
.map_err(|e| e.to_string())
open(path).await
}
pub async fn import_scripts(pool: &SqlitePool, scripts: Vec<Script>) -> Result<(), String> {