feat(database): 添加 SQLite 数据库目录自动创建功能

- 为 SQLite 数据库添加数据库文件目录自动创建逻辑
- 实现 ensureSQLiteDirectory 方法解析数据库路径并创建必要目录
- 支持从 config.Name 或 config.Link 中提取 SQLite 文件路径
- 添加对 SQLite 链接格式 sqlite::@file(path) 的路径解析支持
- 在数据库表迁移前确保 SQLite 数据库文件目录存在
- 新增 sqlitecgo 驱动包实现 SQLite 数据库驱动支持
This commit is contained in:
2026-04-14 09:47:19 +08:00
parent 284f9380ed
commit 33faa6f722
2 changed files with 53 additions and 0 deletions
+6
View File
@@ -50,3 +50,9 @@ func (d *Driver) New(core *database.Core, node *database.ConfigNode) (database.D
func (d *Driver) GetChars() (charLeft string, charRight string) {
return quoteChar, quoteChar
}
// GetMigration returns a Migration instance implementing the Migration interface.
// Note: sqlitecgo driver does not have migration support yet, returns nil.
func (d *Driver) GetMigration() database.Migration {
return nil
}