Watermelon adapter for Origin Private File System #1545
nmeibergen
started this conversation in
General
Replies: 1 comment 3 replies
-
@nmeibergen Excellent, happy to hear that you're working on it! Good timing - I was just writing the other day a guide to contributing new adapters. So let me finish that and I'll give you feedback within a few days |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I developed an application for react native which I now want to extend to the web. As my app requires quite some complicated
SQL
queries using the more basic LokiJS adapter would not suffice. As such I started looking for an alternative which leaves me with no other option than using some SQLite Wasm implementation to leverage the 'full power' of SQL in the browser.Based on everything I read about this Wasm project I figured out that, looking at performance and persistence, the best results should be achievable with the Origin Private File System, see here, here and here.
The out of the box API for OPFS with SQLite Wasm is fairly limited, see the available APIs here: OPFS must be accessed via a worker, and as such the Wasm is also run in a worker, giving limited options. Therefore I started
bare-sqlite-opfs
, see here. I included a couple of methods (likerun
andall
) to easier 'adapt' with Watermelon.bare-sqlite-opfs
in WatermelonDB, see here (which has a slightly messed op fork but is almost on par with the latest watermelondb version).Earlier today I created a 'test' web app to see how it was working: watermelon launches as expected and creates and observes models as expected. So, that is a very good start.
This is all very 'fresh' code which I do not recommend for direct usage in your project. However, based also on your feedback and input I'd like to proceed the necessary development if it is all deemed worthwhile. The code still needs a rigorous testing suite, which is something I need to look into for I am not familiar yet with testing workers.
My main question to you
Beta Was this translation helpful? Give feedback.
All reactions