Skip to content

neighbourhoodie/pouchdb-asyncstorage-adapter-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

pouchdb-asyncstorage-adapter

forked from pouchdb-adapter-asyncstorage

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

Usage

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

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

Android limit

TODO: to be checked if this still relevant in 2024 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.

TODO;

  • Add typescript
  • Check Web Compatibility
  • More todos....

About

asyncstorage adapter for PouchDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published