-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation about Native Access #12
Comments
What do you mean exactly? Do you want to access the database directly from native code, skipping JavaScript? What's your use case for this? |
Sometimes we require shared objects stored between native code and javascript, and that is the reasons for wanting to access database directly from native code. I wondered whether this had direct support for such a thing. |
Currently no. Do you need write access, or only read access? if read-only access, then it should be fairly easy to add support for native access (essentially just expose the DatabaseDriver object that DatabaseBridge - the native module - owns). If you need to write to the database, then that would be in conflict with Watermelon, because if you add new items to the database from native code, Watermelon has no way of knowing that it might need to re-render some components. |
Read access is okey, but write access, if there is a way to implement it, would be much better. It is possible to do it with Realm, one can read and write to the same .realm in Android, IOS and React Native. Having this with read/write ability on native would, in our eyes, make this a solid alternative to Realm. Is there currently a reason that there cannot be a way to have writes in native api ? |
Yeah, like I said:
That makes it challenging to do, because Watermelon is asynchronous and multi-threaded. Not saying it's impossible — I've got some ideas. But that will take some time to implement. |
Closing this for now, as it's not anywhere near the top of the priorities list. If anyone wants to pick up the challange, I can give some guidance, but I warn you — it's not that simple as it seems ;) |
Would you give directions about how to read the data from the native side? My app consists of very long, frequently updating lists that I just can't get good performance out of it. My plan is to rewrite those screens in native Android / iOS, but keep all data writing in JS. |
use DatabaseBridge class, and methods on that. |
There is currently no documentation about native ( android, ios ) access to the db. Is it possible with the current api, or is it done manually via sqlite, or is there simply no documentation ?
Thanks
The text was updated successfully, but these errors were encountered: