We often access a local sqlite database when we developing an app. What is the counterpart in react native? Do I have to use AsyncStorage to store data without a native module?
To install the "app" module, view the Getting Started documentation. # Install & setup the app module yarn add @react-native-firebase/app # Install the database module yarn add @react-native-firebase/database # If you're developing your app using iOS, run this command cd ios/ && pod install && cd ..
React Native is also compatible with server-side databases. The list includes SQL databases, such as: MySQL.
Updated answer: there's now a fledgling SQLite wrapper available:
https://github.com/andpor/react-native-sqlite-storage
Previously:
This comment on Hacker News indicates that there's nothing available right now:
There is currently no native module for SQLite, but you can build one if you want. :-D http://facebook.github.io/react-native/docs/nativemodulesios.html
We use a key-value store for most of our client-side persistence: http://facebook.github.io/react-native/docs/asyncstorage.html
It's by Eric Vicenti who seems to work at Facebook and contribute to React Native, so pretty authoritative.
Full feature SQLite Plugin for React Native is available here:
https://github.com/andpor/react-native-sqlite-storage
Version 2.1.0 supports both iOS and Android and the fmk has both plain JS callback and Promise based interfaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With