Draft
Conversation
…in implementation Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
…ntry Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
…ic-SQL plugin Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Electric SQL sync plugin
feat: add Electric-SQL replication plugin
Mar 11, 2026
Owner
|
@copilot add tests |
Adds test/replication-electric-sql.test.ts with 20 tests covering: - Helper functions: buildElectricUrl, electricMessageToRxDBDocData, hasMustRefetch - Pull replication: basic pull, checkpoint tracking, delete operations, must-refetch handling, custom headers - Push replication: user-provided push handler passthrough - Live replication: real-time polling updates - Error handling: HTTP error emission and recovery - Instance type verification Also fixes must-refetch handling in the pull handler to retry internally instead of returning empty to the replication framework. Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Contributor
Author
Added comprehensive tests in Coverage includes:
Also fixed the must-refetch handling in the pull handler to properly retry from scratch within the handler rather than returning an empty result to the replication framework. |
Owner
|
@copilot add to CI |
Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Contributor
Author
Added in
|
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.
Adds
replication-electric-sqlplugin that syncs PostgreSQL data to RxDB collections via Electric-SQL's shape streaming HTTP API.Plugin (
src/plugins/replication-electric-sql/)/v1/shapeendpoint with offset-based checkpointing. Handlesmust-refetchcontrol messages by retrying from scratch within the pull handler.live=trueafter initial sync, delivering documents directly throughpullStream$. Falls back with retry on error.RxElectricSQLReplicationStateclass follow the same patterns asreplication-supabaseandreplication-firestore.Integration
package.json, generated plugin bridge files inplugins/replication-electric-sql/docs-src/docs/replication-electric-sql.mdwith sidebar entryTests (
test/replication-electric-sql.test.ts)20 tests using mock
fetchfunctions (no backend required):buildElectricUrl,electricMessageToRxDBDocData,hasMustRefetcherror$with recoveryRxElectricSQLReplicationStateCI
test:replication-electric-sqlnpm script inpackage.jsontest-othersjob in.github/workflows/main.ymlalongside other no-backend replication tests (google-drive, microsoft-onedrive)Usage
No dependency on
@electric-sql/client— communicates with Electric over plain HTTP/JSON using the standardfetchAPI (or a user-provided fetch function).💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.