feat: Add SQLite database support and fixed portable extraction path

- Add SQLite as alternative database for offline/firewall environments
- Add --database-type parameter to build-client.bat (mysql/sqlite)
- Refactor database.py to support both MySQL and SQLite
- Add DB_TYPE and SQLITE_PATH configuration options
- Set fixed unpackDirName for portable exe (Meeting-Assistant)
- Update DEPLOYMENT.md with SQLite mode documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-17 13:57:02 +08:00
parent 34947f6262
commit 01d578c67e
7 changed files with 456 additions and 81 deletions

View File

@@ -47,6 +47,10 @@ def apply_config_to_env(config: dict) -> None:
# Database configuration - use direct assignment to ensure config values are used
db_config = backend_config.get("database", {})
if "type" in db_config:
os.environ["DB_TYPE"] = db_config["type"]
if "sqlitePath" in db_config:
os.environ["SQLITE_PATH"] = db_config["sqlitePath"]
if "host" in db_config:
os.environ["DB_HOST"] = db_config["host"]
if "port" in db_config:
@@ -123,11 +127,13 @@ def main():
print(f"DEBUG: Loaded config keys: {list(config.keys())}", flush=True)
backend_config = config.get("backend", {})
db_config = backend_config.get("database", {})
print(f"DEBUG: DB type={db_config.get('type', 'mysql')}", flush=True)
print(f"DEBUG: DB config: host={db_config.get('host')}, user={db_config.get('user')}, pass={'***' if db_config.get('password') else 'EMPTY'}", flush=True)
apply_config_to_env(config)
# Debug: print env vars after setting
print(f"DEBUG: ENV DB_TYPE={os.environ.get('DB_TYPE', 'mysql')}", flush=True)
print(f"DEBUG: ENV DB_HOST={os.environ.get('DB_HOST')}", flush=True)
print(f"DEBUG: ENV DB_USER={os.environ.get('DB_USER')}", flush=True)
print(f"DEBUG: ENV DB_PASS={'***' if os.environ.get('DB_PASS') else 'EMPTY'}", flush=True)