[POC] TanStackDB Attachments#983
Draft
stevensJourney wants to merge 1 commit 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 is a small POC for using our SDK Attachment helpers with TanStackDB collections.
The local only
attachmentstable is kept in sync with a corresponding TanStackDB collection. This allows queries which join TanStackDB collections to the attachments state: e.g.The standard
AttachmentQueueclass is extended to support asaveFilemethod which uses TanStackDB transactions. The mutation of creating a new attachment and associating relational data is done in a single (optimistic) TanStackDB transaction. A TanStackDBupdateHookis provided which allows setting of said relationships.In this demo, the watched attachment items - which represent the wholistic state of present attachment records, are fetched from a TanStackDB watched query.
AI usage disclaimer: I tried using Codex for this, but it was doing a terrible job - so I did it myself. Codex did fix a few typos though.