Need help with pouchdb-react-native?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

stockulus
447 Stars 53 Forks MIT License 458 Commits 28 Opened issues

Description

Pouchdb with async storage

Services available

!
?

Need anything else?

Contributors list

# 222,917
Objecti...
Shell
Java
389 commits
# 187,720
TypeScr...
Objecti...
React N...
Materia...
7 commits
# 281,345
HTML
Electro...
C++
React
7 commits
# 5,109
OCaml
React
reasonm...
node-js
3 commits
# 42,042
ionic
Objecti...
Koa
koa2
2 commits
# 134,730
meteor
Shell
HTML
C++
2 commits
# 749
GitHub
rust-la...
wechat-...
query-l...
2 commits
# 59,467
Swift
Objecti...
Shell
React N...
1 commit
# 25,984
coffees...
ESLint
jonschl...
ecmascr...
1 commit
# 197,615
Shell
CSS
HTML
pouchdb
1 commit
# 271,226
Objecti...
Java
ble
React N...
1 commit
# 291,663
HTML
CSS
toolcha...
ESLint
1 commit
# 693,114
Objecti...
Shell
Java
1 commit

Logo

Maintainers Wantednpm Package npm Package travis-ci.org js-standard-style license

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.

Usage

npm install pouchdb-react-native --save

npm >= 3 / node >= 6 works best, there are some known issues with npm 2

PouchDB 7.0

npm install [email protected] --save
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.

Sample App

there is a small example app: https://github.com/stockulus/pouchdb-react-native/tree/master/example

pouchdb-adapter-asyncstorage

PouchDB adapter using AsyncStorage as its data store. Designed to run in ReactNative. Its adapter name is

'asyncstorage'
.

Usage

npm install pouchdb-adapter-asyncstorage --save
import PouchDB from 'pouchdb-core'
PouchDB.plugin(require('pouchdb-adapter-asyncstorage').default)
const db = new PouchDB('mydb', {adapter: 'asyncstorage'})

// use PouchDB db.get('4711') .then(doc => console.log(doc))

Android limit

On Android asyncstorage has a limitation of 6 MB per default, you might want to increase it

// MainApplication.getPackages()
long size = 50L * 1024L * 1024L; // 50 MB
com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);

known issues

There are still Problems with Attachments, but currently there is work on it. See (https://github.com/stockulus/pouchdb-react-native/issues/68)

development

git clone https://github.com/stockulus/pouchdb-react-native.git
cd pouchdb-react-native
git submodule init
git submodule update
npm install
npm test
cd example
npm run ios


Twitter URL GitHub stars

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.