feat(cli,database): 更新数据库引擎创建模式

This commit is contained in:
2026-06-04 18:51:09 +08:00
parent ee81ccefc5
commit 03928c6c59
6 changed files with 57 additions and 14 deletions
+3 -2
View File
@@ -4,7 +4,8 @@ from importlib.util import find_spec
from pathlib import Path
from typing import Mapping
from nyahome.cli.cli import console, db_driver_available, db_type_allowlist
from nyahome.cli.cli import console
from nyahome.database.engine import db_driver_available, db_type_allowlist
class CliWarning:
@@ -73,7 +74,7 @@ def check_database_type(environ: Mapping[str, str | None]) -> None:
if not db_host:
cw.warning("NYAHOME_DB_HOST 未设置,将使用 [cyan]localhost[/cyan] 作为默认值。")
if not db_port:
cw.warning("NYAHOME_DB_PORT 未设置,将使用 [cyan]3006[/cyan] 作为默认值。")
cw.warning("NYAHOME_DB_PORT 未设置,将使用 [cyan]3306[/cyan] 作为默认值。")
cw.info("自检未检查数据库状态是否可用。")
else:
cw.info("使用 sqlite 数据库,跳过数据库凭证检查。")