feat: add data sync replication planner
/claim #72
Summary
This adds a focused Data Sync plugin foundation for the external-source to internal SQLite replication flow requested in #72.
The PR intentionally keeps the first slice reviewable and reusable:
- adds
DataSyncPluginunderplugins/data-sync - plans bounded cursor-based pulls from PostgreSQL/MySQL/SQLite-style external sources
- supports table allowlists, column mapping, primary-key conflict handling, and batch-size clamping
- defaults to
SELECT *when no explicit column allowlist is configured - writes internal SQLite insert/upsert plans
- stores checkpoints in
tmp_data_sync_checkpoints - records sync runs in
tmp_data_sync_runs - exposes an authenticated admin run endpoint at
/data-sync/run - exports the plugin from
@outerbase/starbasedb/plugins - documents the plugin usage and checkpoint behavior
Why this slice
Issue #72 needs a pull-based replication mechanism with selectable tables, intervals/checkpoints, and append/incremental polling. This PR lands the core replication planner and checkpointed runner so provider-specific scheduling and UI polish can build on a tested base instead of re-implementing query/upsert planning each time.
Validation
./node_modules/.bin/prettier --check plugins/data-sync/index.ts plugins/data-sync/index.test.ts plugins/data-sync/README.md dist/plugins.ts./node_modules/.bin/vitest run plugins/data-sync/index.test.ts src/plugin.test.ts(17 tests)git diff --check
The repo-wide ./node_modules/.bin/tsc --noEmit is still blocked by pre-existing type errors outside this PR (src/do.ts, src/operation.ts, existing tests). The focused plugin tests and formatting checks pass.
Adding a short demo GIF for the Algora bounty review guideline:

It summarizes the focused flow in this PR: configure table allowlist, plan bounded external pulls, upsert into internal SQLite, and persist checkpoints/run history.