Skip to content

Commit

Permalink
fix(tabby-db): create db if missing (#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys authored Feb 5, 2024
1 parent f4fd13b commit 9b8856e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ee/tabby-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ impl DbConn {

pub async fn new() -> Result<Self> {
tokio::fs::create_dir_all(path::db_file().parent().unwrap()).await?;
let options = SqliteConnectOptions::new().filename(path::db_file());
let options = SqliteConnectOptions::new()
.filename(path::db_file())
.create_if_missing(true);
let pool = SqlitePool::connect_with(options).await?;
Self::init_db(pool).await
}
Expand Down

0 comments on commit 9b8856e

Please sign in to comment.