34

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?

4 Answers 4

21

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I just wrote a basic wrapper for SQLite for React Native, not a lot of feature yet but it's a start: github.com/almost/react-native-sqlite
Check out the full blown SQLite plugin for React Native: github.com/andpor/react-native-sqlite-storage
14

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.

Comments

12

Realm React Native enables you to efficiently write your app’s model layer in a safe, persisted and fast way. Here’s what it looks like: See Realm React Native and Docs For Realm

Comments

5

Embedded persistent or in memory database for react-native https://github.com/smartdemocracy/react-native-local-mongodb

It's have Performance statistics

  • Insert: 10,680 ops/s
  • Find: 43,290 ops/s
  • Update: 8,000 ops/s
  • Remove: 11,750 ops/s

2 Comments

Beware of the choice of a NoSQL database if the data to be stored is relational.
Realm also support relations, its well documented too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.