npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kanchingyg/dbwatch

v0.1.1

Published

Git-style live row diff for SQLite/D1/Postgres around any command, with instant rollback

Downloads

73

Readme

dbwatch

ci npm JSR JSR Score Runtime license

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

Install

Bun / npm:

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

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

JSR:

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

Quick start

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

Local models

npx @kanchingyg/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.

MCP Tools Reference

| Tool | Mutates | Description | | --- | --- | --- | | run_with_db_diff | true | Snapshot SQLite/D1 tables, execute a child command, and return exit status plus row-level INSERT/UPDATE/DELETE diffs (requires --allow-write). | | revert_last_diff | true | Execute inverse SQL statements from the most recent captured diff to restore prior table state (requires --allow-write). | | explain_side_effects | false | Summarize captured row mutations in two lines via a local Ollama or OpenAI-compatible model. |

Editor and Agent Integration

Cursor (.cursor/mcp.json)

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

Claude Code CLI

claude mcp add dbwatch -- npx -y @kanchingyg/dbwatch --mcp

Programmatic Usage (JSR / TypeScript)

import * as bridge from "jsr:@kanchingyg/dbwatch/bridge";

Runtime Safety and Guardrails

  • Stdio frame isolation: --mcp keeps JSON-RPC on stdout clean.
  • Read-only default: run_with_db_diff / revert_last_diff need --allow-write; --dry-run simulates.
  • Loop breaker: Identical MCP tool calls halt after three repeats.
  • Revert SQL: Inverse statements use quoted identifiers and escaped literals (SQLite/D1 local files only today).

License

MIT