Skip to content

CAT 029

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-029 — DB.open resource leak

Severity: error | Confidence: high | Auto-fix:

Warning

This rule flags real bugs, not just performance issues.

Description

DB.open resource leak — Database connections opened with DB.open must be closed. Use the block form for automatic cleanup.

Bad code

db = DB.open("sqlite3:./data.db")
rows = db.query_all("SELECT * FROM users")

Performance Impact

Tip

This rule can significantly improve performance in hot code paths.

Benchmark

Note

See bench results at bench/cat-029/

Clone this wiki locally