Documentation
¶
Index ¶
Constants ¶
View Source
const SystemVersionKey = "system_version"
SystemVersionKey 是记录“上次启动所用版本标识”的配置键(存于 configs 表)。 取代旧的 ./data/.komari-version 文件:版本标识随配置库一起备份/恢复, 也避免额外的裸文件依赖。
Variables ¶
This section is empty.
Functions ¶
func GetDBInstance ¶
GetDBInstance 返回全局数据库实例。 为兼容既有大量调用点,这里保留“出错即退出”的语义; 需要错误处理的启动流程应优先调用 Initialize()。
func Initialize ¶
func Initialize() error
Initialize 显式初始化数据库连接与表结构,仅执行一次。 与 GetDBInstance 不同,Initialize 返回错误而非直接退出进程, 便于启动生命周期统一处理错误、以及在测试/CLI 命令中做隔离。
func ReclaimSpace ¶
ReclaimSpace checkpoints the main database WAL and rewrites the SQLite file.
func SetVersionID ¶
func SetVersionID(id string)
SetVersionID 设置当前构建的版本标识(通常为 CurrentVersion+"-"+VersionHash), 用于版本升级检测与自动备份。应在 Initialize() 之前调用;为空则跳过升级备份。
func StorageSize ¶
StorageSize returns the bytes occupied by the main SQLite database and its WAL/SHM sidecar files.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.