• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 28026600674

23 Jun 2026 12:30PM UTC coverage: 64.768% (-0.2%) from 64.97%
28026600674

push

github

web-flow
feat(cli): port db diff and db pull to native TypeScript (CLI-1313) (#5620)

Ports `supabase db diff` and `supabase db pull` from the Go CLI to
native Effect handlers in the legacy shell, replacing their Phase-0
proxy stubs. Linear: CLI-1313. Builds on the pg-delta infrastructure
merged in #5586.

## What changed

**Shared engine (promotion + new modules)**
- Promotes the pg-delta engine — adapter, seam, cache, deno-templates,
declarative write, and its errors — out of `db/schema/declarative/` into
`db/shared/legacy-pgdelta.*`, so `diff`, `pull`, and `declarative`
import one copy. The `generate`/`sync` call sites are updated in the
same change; `findDropStatements` is hoisted to `legacy-sql-split.ts`.
- New shared modules: `legacy-diff-engine.ts` (pure `resolveDiffEngine`
/ `resolvePullDiffEngine` / `shouldUsePgDelta`), `legacy-migra.*`
(byte-exact Go templates + a `legacyDiffMigra` free function over the
pg-delta context with the OOM→`supabase/migra` bash fallback), and
migration-file helpers.

**Live-shadow Go seam**
- Adds a hidden `db __shadow` command (with `PrepareShadowSource` /
`PrepareRawShadow`, refactored out of `DiffDatabase` /
`pullDeclarativePgDelta`). It provisions the shadow Postgres, prints its
connection URL + container id, and leaves it running so the native TS
handler runs migra/pg-delta against it and tears it down — mirroring
Go's `differ(shadowConfig, config)` for both engines (migra needs a live
source, which the catalog-file `__catalog` seam couldn't provide).
`start.SetupDatabase` stays unported, which is why provisioning remains
in Go.

**db diff**
- Native pg-delta / migra diff via edge-runtime; explicit
`--from`/`--to` mode (always pg-delta). `--use-pgadmin` /
`--use-pg-schema` rebuild the argv and delegate to the bundled Go binary
(telemetry disabled on the child so the single `cli_command_executed`
event comes from the TS command).

**db pull**
- Native pg-delta / migra migration pull + `--declarative` pg-delta
export; r... (continued)

10804 of 16681 relevant lines covered (64.77%)

10.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

59.17
/internal/db/diff/diff.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc