From 0defc829dd56b0ed8558f04c42b24f0ac0540aa0 Mon Sep 17 00:00:00 2001 From: egg Date: Thu, 18 Dec 2025 09:10:45 +0800 Subject: [PATCH] fix: Make SQLite default for embedded-backend mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When --embedded-backend is specified, SQLite is now the default database type instead of MySQL. This is the expected behavior for all-in-one deployment where the app should work offline without external database. Users can still explicitly specify --database-type mysql if needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- scripts/build-client.bat | 41 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/scripts/build-client.bat b/scripts/build-client.bat index 2ac5312..0dceefa 100644 --- a/scripts/build-client.bat +++ b/scripts/build-client.bat @@ -509,7 +509,12 @@ call :update_config REM 更新 embedded backend 設定(如果有指定) call :update_config_embedded -REM 更新資料庫類型設定(如果有指定) +REM 內嵌後端模式預設使用 SQLite(除非明確指定 mysql) +if "%EMBEDDED_BACKEND%"=="true" ( + if "%DATABASE_TYPE%"=="" set "DATABASE_TYPE=sqlite" +) + +REM 更新資料庫類型設定 call :update_config_database if "%SKIP_SIDECAR%"=="false" ( @@ -578,35 +583,33 @@ echo clean 清理建置目錄 echo help 顯示此幫助訊息 echo. echo 選項: -echo --api-url URL 後端 API URL (預設: http://localhost:8000/api) +echo --api-url URL 後端 API URL echo --skip-sidecar 跳過 Sidecar 打包 -echo --skip-backend 跳過 Backend 打包 (預設) -echo --embedded-backend 打包內嵌後端 (全包部署模式) -echo --database-type TYPE 資料庫類型: mysql (雲端) 或 sqlite (本地) -echo --target TARGET 打包目標: nsis (安裝檔, 預設) 或 portable (免安裝) +echo --skip-backend 跳過 Backend 打包 +echo --embedded-backend 打包內嵌後端,預設使用 SQLite +echo --database-type TYPE 資料庫類型: sqlite 或 mysql +echo --target TARGET 打包目標: nsis 或 portable echo --clean 建置前先清理 echo. echo 範例: -echo %~nx0 build 完整建置 (NSIS 安裝檔) -echo %~nx0 build --embedded-backend 全包部署 (含內嵌後端) -echo %~nx0 build --embedded-backend --database-type sqlite 全包部署 + SQLite -echo %~nx0 build --target portable 打包為免安裝 Portable -echo %~nx0 build --api-url "http://192.168.1.100:8000/api" 指定遠端後端 +echo %~nx0 build 完整建置 +echo %~nx0 build --embedded-backend 全包部署,SQLite 本地資料庫 +echo %~nx0 build --embedded-backend --database-type mysql 全包部署,MySQL 雲端 +echo %~nx0 build --target portable 打包為 Portable echo %~nx0 sidecar 僅打包 Sidecar echo %~nx0 electron --skip-sidecar 僅打包 Electron echo. echo 部署模式: -echo 分離部署(預設): 前端連接遠端後端,使用 --api-url 指定後端地址 -echo 全包部署: 使用 --embedded-backend 將後端打包進 exe,雙擊即可運行 +echo 分離部署: 前端連接遠端後端,使用 --api-url 指定後端地址 +echo 全包部署: 使用 --embedded-backend,預設 SQLite 本地資料庫 echo. echo 打包目標: -echo nsis(預設): 產生安裝檔,安裝後資料持久保存,推薦正式使用 -echo portable: 產生免安裝 exe,臨時資料夾會在關閉時清空 -echo SQLite 資料庫會自動儲存到 %%APPDATA%%\Meeting-Assistant +echo nsis: 產生安裝檔,推薦正式使用 +echo portable: 產生免安裝 exe,SQLite 資料庫儲存到 %%APPDATA%% echo. -echo 資料庫模式: -echo MySQL(預設): 連接雲端資料庫,需要網路存取 -echo SQLite: 本地資料庫,適合離線或防火牆環境,使用 --database-type sqlite +echo 資料庫模式 - 全包部署時: +echo SQLite 預設: 本地資料庫,完全離線運作 +echo MySQL: 需明確指定 --database-type mysql,連接雲端資料庫 echo. echo 注意: echo - 首次打包 Sidecar 需下載 Whisper 模型,可能需要較長時間