Skip to content

feat(data-migrate): apply up to 2,000 row ops, one cap shared by screen and route - #560

Merged
huyplb merged 2 commits into
mainfrom
feat/data-migrate-2000
Oct 26, 2026
Merged

huyplb merged 2 commits into
mainfrom
feat/data-migrate-2000

Conversation

@huyplb

@huyplb huyplb commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Phase B of docs/plans/2026-10-17-data-compare-and-sql-tracer.md, following #559.

Change

  • DATA_MIGRATE_MAX_OPS = 2000 lives in @foxschema/shared. The browser's cap (DATA_MIGRATE_ROW_CAP) and the /data-migrate/execute check both read it. Before, each side held its own copy of 500.
  • 2,000 matches the compare window, so every difference a compare run finds can be applied from the screen that found it. Past that, the Server Beam pointer stays.
  • The plan expected the restore snapshot to need chunking (Oracle's IN-list limit), but it doesn't. The snapshot is built in the browser from the destination rows already loaded, with no key IN-list query, and 2,000 rows fit the 10 MB body limit.

Tests

  • data-migrate.routes.test.ts: 2,000 ops are accepted and 2,001 are refused with 400. The old 500 cap would have refused 2,000.
  • resultRowDiff.test.ts: 2,100 ops are cut to the shared cap of 2,000.
  • Typecheck and lint are clean. The data-migrate, sql-editor and shared suites pass.

🤖 Generated with Claude Code


Note

Medium Risk
Raises the volume of DML per request and changes a shared contract; behavior is bounded by existing migrate guards and tests, but larger batches increase blast radius if mis-synced rows are applied.

Overview
Side-by-side Data migrate can now apply up to 2,000 insert/update/delete ops in one batch (was 500). The limit is defined once as DATA_MIGRATE_MAX_OPS in @foxschema/shared; the SQL editor’s DATA_MIGRATE_ROW_CAP and POST /data-migrate/execute both read that value so the UI and API stay aligned.

2,000 matches the compare window size, so differences found in a full compare run can be migrated from the same screen without hitting the old cap first. Compare hints and migrate bar copy use the shared constant for the displayed limit; larger batches still point users to Server Beam.

Tests cover client-side truncation at 2,000 ops and server acceptance of 2,000 vs rejection of 2,001.

Reviewed by Cursor Bugbot for commit b07bb75. Bugbot is set up for automated code reviews on this repo. Configure here.

…en and route

The browser capped Data migrate at 500 ops and the route refused more than
500, each holding its own copy. DATA_MIGRATE_MAX_OPS (2,000, in
@foxschema/shared) now drives both, matching the compare window so every
difference a compare run finds can be applied from the screen that found
it. Past it, the Server Beam pointer stays.

The restore snapshot is built from the destination rows already loaded (no
key IN-list query), so 2,000 rows need no chunking; the 10 MB body limit
holds them.

Phase B of docs/plans/2026-10-17-data-compare-and-sql-tracer.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: d610fc9d-c40b-4f7f-a288-404682ca7994)

# Conflicts:
#	apps/web/src/frontend/features/sql-editor/components/ResultsPanel.tsx
@cursor

cursor Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: e6f61331-602f-495b-a18a-d46a76c359fa)

@huyplb
huyplb merged commit 28cc081 into main Oct 26, 2026
12 checks passed
@huyplb
huyplb deleted the feat/data-migrate-2000 branch October 26, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant