pouchdb-react-native
Version:
PouchDB Bundle for ReactNative
48 lines (31 loc) • 2.5 kB
Markdown

pouchdb-react-native
======
PouchDB, the ReactNative-only edition. A preset representing the PouchDB code that runs in ReactNative.
The `pouchdb-react-native` preset contains the version of PouchDB that is designed for ReactNative. In particular, it ships with the AsyncStorage adapters as its default adapters. It also contains the replication, HTTP, and map/reduce plugins.
[](https://www.bithound.io/github/stockulus/pouchdb-react-native) [](https://www.npmjs.com/package/pouchdb-react-native) [](https://www.npmjs.com/package/pouchdb-react-native) [](https://travis-ci.org/stockulus/pouchdb-react-native) [](http://standardjs.com/) [](https://opensource.org/licenses/MIT)
### Usage
```bash
npm install pouchdb-react-native --save
```
npm >= 3 / node >= 6 works best, there are some known issues with npm 2
```js
import PouchDB from 'pouchdb-react-native'
const db = new PouchDB('mydb')
// use PouchDB
db.get('4711')
.then(doc => console.log(doc))
```
For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
### Android limit
On Android asyncstorage has a limitation of 6 MB per default, you might want to increase it
```java
// MainApplication.getPackages()
long size = 50L * 1024L * 1024L; // 50 MB
com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);
```
### Sample App
there is a small example app:
https://github.com/stockulus/pouchdb-react-native/tree/master/example
---
[](https://twitter.com/stockulus) [](https://github.com/stockulus/pouchdb-react-native)