Skip to main content
Glama

dbwatch

ci npm JSR Bun license

One line: npx dbwatch sqlite:./app.db -- npm test (or bunx dbwatch sqlite:./app.db -- bun test): git-style SQLite/D1 row diff around any command with instant --revert.

Install

Bun / npm:

bunx dbwatch sqlite:./local.db -- npm test
npx dbwatch sqlite:./local.db -- npm test

# or install in your project / globally
bun add -d dbwatch
npm i -D dbwatch

JSR:

bunx jsr add @kanchingyg/dbwatch
npx jsr add @kanchingyg/dbwatch

Related MCP server: litescope

Quick start

npx dbwatch sqlite:./local.db -- npm test
bunx dbwatch sqlite:./local.db -- bun test
npx dbwatch sqlite:./local.db --revert --allow-write -- npm test
npx dbwatch --mcp

MCP tools

Tool

Purpose

run_with_db_diff

Wrap a command; returns exit code + compact row diff (--allow-write; --dry-run simulates)

revert_last_diff

Apply inverse SQL (--allow-write; --dry-run previews SQL)

explain_side_effects

Two-line local summary via Ollama / OpenAI-compatible API

Add to Cursor or Claude Code:

{
  "mcpServers": {
    "dbwatch": {
      "command": "npx",
      "args": ["-y", "dbwatch", "--mcp"]
    }
  }
}

Local models

npx dbwatch sqlite:./app.db --explain --model ollama/qwen2.5-coder:7b

Point baseUrl in MCP explain_side_effects to LM Studio or vLLM (http://127.0.0.1:1234).

Supported DSNs

  • sqlite:./path/to.db or file:./path/to.db

  • d1:./local-d1.sqlite (local Cloudflare D1 SQLite file)

  • Postgres DSN parsing is reserved; use SQLite/D1 for zero-config local diffs today.

License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Change tracking for AI-era codebases. AI agents call it to log structured change events (entity + diff + reasoning) before the session ends, then query history with diff, blame, history, changeset, and search. Captures the intent that would otherwise evaporate.
    8
    236 PyPI
    25
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Operations toolchain for SQLite, Cloudflare D1, and Turso. Every command is available as both a CLI and an MCP tool: inspect, diff, migrate, monitor, back up, and repair databases. 22 stdio tools, read-only by default.
    14
    1
    AGPL 3.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables database governance for Drizzle ORM projects by inspecting schemas, linting migrations for unsafe operations, detecting schema drift, and explaining query plans with performance checks.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Captures checkpoints of project files and SQLite tables before an AI agent makes risky changes, then reports differences and rolls them back byte-for-byte, including dropped tables and agent-created junk. Enables agents to snapshot, diff, list, and restore working state with explicit confirmation required before any destructive action.
    9 npm
    1
    MIT