1
0

feat: 新增 DB checker — 支持 PostgreSQL/MySQL/SQLite 连接测试与 SQL 查询断言

- 实现 db 类型 checker,使用 Bun 内置 SQL 类
- 支持 db.url 连接字符串和可选 db.query 查询语句
- expect 支持 maxDurationMs、rowCount、rows 逐列校验
- 凭据屏蔽序列化输出
- SQLite 内存数据库测试覆盖
This commit is contained in:
2026-05-16 09:00:15 +08:00
parent c36df94e59
commit 146cef982e
16 changed files with 1344 additions and 7 deletions

View File

@@ -66,8 +66,8 @@ describe("CheckerRegistry", () => {
const second = createDefaultCheckerRegistry();
first.register(createChecker("custom"));
expect(first.supportedTypes).toEqual(["http", "cmd", "custom"]);
expect(second.supportedTypes).toEqual(["http", "cmd"]);
expect(first.supportedTypes).toEqual(["http", "cmd", "db", "custom"]);
expect(second.supportedTypes).toEqual(["http", "cmd", "db"]);
expect(
first.definitions.every(
(checker) => checker.schemas.config && checker.schemas.defaults && checker.schemas.expect,