fix: prevent implicit database creation on connection for SQLite (#1986)

This commit is contained in:
hb authored and GitHub committed 2026-06-27 12:31:02 +08:00
1 parent b226ab174b
commit 7b08307896
4 files changed
+18 -18

No files matched your search

+2 -8
View File
@@ -605,12 +605,7 @@ pub async fn test_connection(state: State<'_, Arc<AppState>>, config: Connection
extension
})
.collect();
match db::sqlite::connect_path_create_if_missing_with_extensions(
&expand_tilde(&config.host),
extensions,
)
.await
{
match db::sqlite::connect_path_with_extensions(&expand_tilde(&config.host), extensions).await {
Ok(_) => Ok("Connection successful".to_string()),
Err(e) => Err(e),
}
@@ -875,8 +870,7 @@ pub async fn connect_db(state: State<'_, Arc<AppState>>, config: ConnectionConfi
})
.collect();
PoolKind::Sqlite(
db::sqlite::connect_path_create_if_missing_with_extensions(&expand_tilde(&db_config.host), extensions)
.await?,
db::sqlite::connect_path_with_extensions(&expand_tilde(&db_config.host), extensions).await?,
)
}
DatabaseType::Redis => {