feat(plugins): implement external data replication plugin (#72) - #295
Open
mini0n-ai wants to merge 1 commit into
Open
feat(plugins): implement external data replication plugin (#72)#295mini0n-ai wants to merge 1 commit into
mini0n-ai 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.
Summary
Resolves #72 by implementing a full pull-based external replication plugin (
plugins/replication) that replicates data from an external data source into the internal Durable Object SQLite instance./claim #72
Resolves #72
Architecture & Key Features
Pull-based & Append-only Engine (
ReplicationPlugin):id,created_at, or custom key).tmp_replication_checkpoints.idvs timestamp string) using JSON serialization.INSERT OR REPLACEfor idempotent re-pulls and retry safety.Automatic Destination Table Provisioning:
CREATE TABLE IF NOT EXISTSusing the source schema column definitions and setsPRIMARY KEYon the tracked key.Transparent Querying (
beforeQueryHook):SELECT * FROM public.users) to the corresponding internal SQLite table name (users), providing seamless compatibility without requiring client-side SQL alterations.Cadence & Monitoring Endpoints:
intervalSeconds(evaluating elapsed intervals and executing viawaitUntilto prevent request blocking).POST /replication/pull: triggers an immediate manual replication run.GET /replication/status: returns current checkpoint positions, record counts, and timestamp of the last pull.@outerbase/starbasedb/pluginsand the Cron plugin (cronPlugin.onEvent).Automated Test Suite
plugins/replication/index.test.tsandplugins/replication/utils.test.ts:Bounty Sovereign Wallet (Base L2 USDC):
0x46D5318E4397cFcBED06a235c1604E473682Ea1F