Repository navigation
feat(plugins): add ReplicationPlugin for external-to-internal data sync (#72) - #349
Open
SuperPiIot wants to merge 1 commit into
Open
SuperPiIot wants to merge 1 commit into
SuperPiIot wants to merge 1 commit into
Conversation
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
Fixes #72
Summary
Implements
ReplicationPlugin(plugins/replication/) for StarbaseDB to replicate data from external sources into internal StarbaseDB tables inside Durable Objects.Features & Architecture
StarbasePlugin+Operation+CronPlugin): ExtendsStarbasePluginand integrates cleanly with StarbaseDB'sOperation/OperationCollectionAST pipeline andCronPluginscheduler for automatic background synchronization.dataPathextraction) as well as programmatic custom puller functions (registerPuller())._starbase_replication_state(including updated timestamp / cursor token and sync status).INSERT OR REPLACE/ upserts into destination tables (with optionalautoCreateTableschema inference).POST /replication/sync(on-demand sync trigger) andGET /replication/status(sync watermarks and health status).plugins/replication/meta.json,plugins/replication/README.md, and exportsReplicationPluginfromdist/plugins.ts.Verification
plugins/replication):npx tsc --noEmit 2>&1 | grep -n "plugins/replication"returned 0 errors inplugins/replication/.npx vitest run plugins/replication/index.test.ts— 1 passed (1 file), 5 passed (5 tests).npx vitest run— 19 passed / 1 failed (20 files), 156 passed / 4 failed (160 tests). The 4 failures are pre-existing upstream failures in untouchedsrc/rls/index.test.ts(should modify SELECT queries with WHERE conditions,should apply RLS policies to tables in JOIN conditions,should apply RLS policies to multiple tables in a JOIN,should apply RLS policies to subqueries inside FROM clause).