Diff two databases
litescope_diffCompare two databases and output schema and row-count differences in JSON format. Compatible with local files, D1, and Turso.
Instructions
Compare two SQLite or D1 databases and return their schema and row-count differences as JSON. Works across any combination of local files, D1, and Turso — e.g. diff a local migration target against a live D1 database. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | Changed ('after') source — 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). | |
| old | Yes | Baseline ('before') source — 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). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes | Counts of tables added/removed/modified. | |
| data_changes | No | Per-table row-count differences (present when data differs). | |
| schema_changes | Yes | Per-table schema differences. |