Comments (8)
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 ;)
from watermelondb.
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?
from watermelondb.
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.
from watermelondb.
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.
from watermelondb.
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 ?
from watermelondb.
Is there currently a reason that there cannot be a way to have writes in native api ?
Yeah, like I said:
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.
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.
from watermelondb.
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.
from watermelondb.
use DatabaseBridge class, and methods on that.
from watermelondb.
Related Issues (20)
- [Question] Query in associations tables with multiply levels
- How can I reload observe when I come from background to foreground ios
- experimentalSubscribe with useSyncExternalStore doesn't re render on update
- error [TypeError: Cannot read property 'get' of undefined]
- Crash: Closing database followed by Error: Leak detected! HOT 1
- Prevent erros when the relation was deleted (with observers) HOT 1
- @nozbe/watermelondb Error: Row too big to fit into CursorWindow requiredPos=4, totalRows=5
- experimentalFailsafe always return undefined even if relation exist.
- Is it possible to execute multiple queries in a single statement ? HOT 1
- Module '"@nozbe/watermelondb/decorators"' has no exported member 'experimentalFailsafe'.
- "Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome"
- SyncPullStrategy should associate with table instead of sync
- TimeStamp HOT 2
- Local Storage API - Add support for db.localstorage.key() to fetch all key at runtime
- [question] How to install extensions
- Web Bundling failed
- TypeError: Super expression must either be null or a function HOT 2
- Can we get current migration versions like fromVersion and toVersion
- Different between using `@lazy` decorator vs getter?
- Support for Expo SDK50 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watermelondb.