Diagnose database locks
litescope_locksDiagnose SQLite database locking issues by inspecting PRAGMA settings and live lock state. Returns a JSON report with verdict and specific changes to apply for local files, D1, or Turso.
Instructions
Diagnose "database is locked" / SQLITE_BUSY and writer-starvation problems — the most common SQLite production failure. Inspects journal mode, busy_timeout, locking mode, and WAL bloat for local files, and returns provider-specific guidance for D1 and Turso. Each finding includes the exact PRAGMA or DSN change to apply. Returns a JSON report with a verdict (ok / attention / critical).
Set live=true (local files only) to instead probe the current lock state: whether a writer is holding the lock right now and which processes have the file open. Use this when an app is actively reporting "database is locked". Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| live | No | Probe the live lock state right now instead of static PRAGMA config (local files only) | |
| source | Yes | Database source: a local file path (./app.db), a Cloudflare D1 DSN (d1://DB_ID when CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID are set, or d1://TOKEN@ACCOUNT_ID/DB_ID), or a Turso DSN (turso://TOKEN@ORG/DB). |