feat: Initial PoC#1
Draft
Chriztiaan wants to merge 3 commits into
Draft
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.
This PoC explores ideas for defining a template write path that should simplify implementing writes for PowerSync users. It is based on the node backend and client demos.
The core shift in this PoC is moving the "translation problem" from the client to the server edge. Right now, every developer has to write their own bespoke
uploadDatahandler that fetches CRUD ops, maps types, talks to their backend, and classifies errors. This PoC says: what if the client just sends the raw CRUD data over the wire, and a standardised server-side stack handles everything from there? The backend includes generated endpoint handler code (via OpenAPI), a mechanism for mapping sqlite crud data to the format of a source database, and a persister for each support source database.This is essentially a foundation layer, it defines the protocol with the happy path in mind, and both the mutator example (PoC 2) and the Supabase edge function approach (PoC 3) are described as things that can ride on top of it. We also still need to improve the implementation detail at this level in terms of interface definitions and hooks for supporting custom logic on every layer, as well as advanced tools like dead letter queues.
Adding OpenAPI codegen means that some of the implementation can be spread to new languages/platforms without reimplementing the wire code each time
AI disclosure
This PR was created with the help of Claude Code. Help constitutes assistance in research, planning, and rough outline of implementation. Beyond having a hand in the implementation, I have also manually tested this work.