7.0.1 • Published 4 years ago

pouchdb-adapter-as v7.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

pouchdb-adapter-as

PouchDB adapter using community/asyncStorage as its data store. Its adapter name is 'asyncstorage'.

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

Usage

npm install pouchdb-adapter-as --save
import PouchDB from 'pouchdb-core'
PouchDB.plugin(require('pouchdb-adapter-as').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);

For full API documentation and guides on PouchDB, see PouchDB.com. For details on PouchDB sub-packages, see the Custom Builds documentation.


GitHub stars