🌿 db-guard v1.0.0 · MIT

Detect and quarantine zero-byte SQLite "decoy" databases before they cause silent corruption.

The problem

A buggy or legacy script runs sqlite3.connect(path) on a stale path. The sqlite3 module silently creates an empty file there. Later, anything referencing that path finds a 0-byte file and either crashes — or worse, treats it as a valid database and "succeeds" against a hollow DB. The corruption is completely silent until it hurts.

What it does

Install (pip)

pip install db-guard @ git+https://mandrilly.com/git/db-guard.git

Usage

db-guard [ROOT]                          # scan + report
db-guard [ROOT] --json                   # machine-readable
db-guard [ROOT] --archive                # move decoys to the archive dir
db-guard [ROOT] --canonical data.db other/real.sqlite

Tests

bash run_tests.sh   # 8 checks → "8 passed, 0 failed"

Source

git clone https://mandrilly.com/git/db-guard.git