From 9b8856e35896e82c1346de95bef91220af5a4cdc Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sun, 4 Feb 2024 19:45:36 -0800 Subject: [PATCH] fix(tabby-db): create db if missing (#1378) --- ee/tabby-db/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/tabby-db/src/lib.rs b/ee/tabby-db/src/lib.rs index 5835989055fb..cbaf91d6aedb 100644 --- a/ee/tabby-db/src/lib.rs +++ b/ee/tabby-db/src/lib.rs @@ -42,7 +42,9 @@ impl DbConn { pub async fn new() -> Result { 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 }