Lance Add
73211707fb
refactor(container): add default nil checker, rename RegisterNilChecker to SetNilChecker, migrate instance containers to type-safe generics (#4630)
## 变更说明
本 PR 主要对代码库进行了重构,以提升类型安全性和优化连接管理实现。
### 详细变更
#### 1. 数据库连接管理优化
- 修改 `RegisterNilChecker`方法返回实例以支持链式调用,涉及
`KVMap`、`ListKVMap`、`TSet`、`AVLKVTree`、`BKVTree`、`RedBlackKVTree`
等多个容器类型
- 更新 `Core`结构体中 `links`字段类型为类型安全的 `KVMap[ConfigNode, *sql.DB]`
- 添加专门的链接检查器函数用于连接池管理
- 使用泛型 `KVMap`替代原始 map 类型提升类型安全性
- 简化连接关闭逻辑并移除不必要的类型断言
- 优化统计功能中的迭代器实现提高性能
#### 2. 数据库驱动类型安全增强
- 将 dm、gaussdb、mssql、oracle 驱动中的 `conflictKeySet` 从 `gset.New`修改为
`gset.NewStrSet`
- 统一使用字符串集合类型以提高类型安全性
#### 3. 配置文件适配器类型安全改进
- 将 `jsonMap`从 `StrAnyMap` 类型更改为泛型 `KVMap[string, *gjson.Json]` 类型
- 添加 `jsonMapChecker` 函数用于 JSON 对象验证
- 使用 `NewKVMapWithChecker` 替代 `NewStrAnyMap` 提高类型安全性
- 简化数据库链接关闭日志中的键值转换逻辑
## 影响范围
- 数据库连接管理模块
- 多个数据库驱动实现
- 配置文件管理系统
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: John Guo <john@johng.cn>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-23 16:37:38 +08:00
..
2025-11-28 21:41:30 +08:00
2025-11-28 21:41:30 +08:00
2025-11-28 21:41:30 +08:00
2025-11-28 21:41:30 +08:00
2026-01-23 16:37:38 +08:00
2025-11-28 21:41:30 +08:00
2025-11-28 21:41:30 +08:00
2025-11-28 21:41:30 +08:00
2026-01-23 16:37:38 +08:00
2025-11-29 20:57:41 +08:00
2025-11-29 21:09:43 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-28 21:41:30 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-28 21:41:30 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2026-01-23 16:37:38 +08:00
2026-01-23 16:37:38 +08:00
2026-01-23 16:37:38 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00
2025-11-21 14:12:56 +08:00