AGENT SKILL

audit-sqlite-usage

Audit all bun:sqlite call sites for correctness against the rules in bun-sqlite.md and cross-platform.md.

License 许可
MIT
最近更新
2026-07-02
Stars
★ 0
Forks
0

01 前言 Front Matter

name
audit-sqlite-usage
description
Audit all bun:sqlite call sites for correctness against the rules in bun-sqlite.md and cross-platform.md.

03 SKILL.md 正文

Audit SQLite Usage

When to use

Use when touching any file under src/core/io/sqlite/ or any source collector that opens a sqlite DB; when fixing sqlite-related test failures on Windows.

Key files

  • src/core/io/sqlite/open.ts
  • src/core/io/fs/rm-recursive.ts
  • src/services/buffer/db.ts
  • src/sources/cursor/
  • src/sources/codex/

Common pitfalls

  • Using ?immutable=1 URI flag (works on macOS, fails on Linux/Windows); use SQLITE_OPEN_READONLY | SQLITE_OPEN_URI flags explicitly.
  • Using node:fs/promises.rm for teardown on Windows (EBUSY); use rmRecursive instead.
  • Forgetting to extend afterEach timeout to 30 s for tests that open sqlite.
  • Executing real SQL in unit tests — all sqlite tests must use dependency injection.
  • Missing the double-attempt open pattern for source databases (try openReadOnly, fallback to { immutable: true } on any error).

04 同仓库更多 Skills