feat: add DataSync plugin with adapter pattern#137
Open
selenaalpha77-sketch wants to merge 2 commits intoouterbase:mainfrom
Open
feat: add DataSync plugin with adapter pattern#137selenaalpha77-sketch wants to merge 2 commits intoouterbase:mainfrom
selenaalpha77-sketch wants to merge 2 commits intoouterbase:mainfrom
Conversation
Implements DataSyncPlugin following maintainer feedback on PR outerbase#75: - Adapter pattern: PostgresSync and MySQLSync classes extend DataSyncAdapter - Configurable trackingColumn per table (no hardcoded column names) - Strips public. schema prefix in SQLite table creation and beforeQuery hook - Metadata table named tmp_data_sync_metadata (tmp_ prefix convention) - Uses Durable Object alarms (not setInterval) via dataSource.rpc.setAlarm - 24 tests covering plugin lifecycle, query rewriting, sync logic, and type mapping Closes outerbase#72
Follows the standard plugin structure used by all other StarbaseDB plugins (cron, stripe, resend, etc.) — every plugin ships with README.md and meta.json.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/claim #72
/attempt #72
Changes
Implements DataSyncPlugin following maintainer feedback on PR #75.
Adapter pattern: DB-specific logic in DataSyncAdapter subclasses (PostgresSync, MySQLSync). New engine = new subclass, no changes to DataSyncPlugin itself.
Configurable trackingColumn per table: no hardcoded column names.
Schema prefix handling: public.tablename stripped to tablename in SQLite table creation and beforeQuery hook.
tmp_ prefix: metadata table is tmp_data_sync_metadata.
Cloudflare alarms: dataSource.rpc.setAlarm(nextTime). No setInterval.
24 unit tests, all passing.
Closes #72