Skip to content

feat(plugins): add replication plugin for external database sync (#72)#274

Open
singhaditya21 wants to merge 2 commits into
outerbase:mainfrom
singhaditya21:feat-replication-plugin
Open

feat(plugins): add replication plugin for external database sync (#72)#274
singhaditya21 wants to merge 2 commits into
outerbase:mainfrom
singhaditya21:feat-replication-plugin

Conversation

@singhaditya21

@singhaditya21 singhaditya21 commented Jun 13, 2026

Copy link
Copy Markdown

closes #72
/claim #72

This PR introduces the replication plugin to sync data from external databases (Postgres, MySQL, Turso) into the internal DO SQLite database.

Demo Video:

https://github.com/singhaditya21/starbasedb/raw/feat-replication-plugin/tests/assets/replication_demo.webm

Changes

  • Created ReplicationPlugin in plugins/replication/.
  • Supports keyset pagination (using configured cursorColumn) and limit/offset fallback.
  • Automatically registers cron tasks in the Durable Object alarm table and intercepts /cron/callback to trigger replication periodically.
  • Safely quotes identifiers (quoteIdentifier) to prevent SQL injections.
  • Type maps fields (Boolean, JSON, numbers) to SQLite-compatible types.
  • Added comprehensive Vitest test coverage.

@singhaditya21

Copy link
Copy Markdown
Author

Hi! This PR is ready for review and verified to pass all tests locally. Could you please click 'Approve and run' to trigger the automated CI workflows? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replicate data from external source to internal source with a Plugin

1 participant