pouchdb-adapter-react-native-leveldb

0.5.0 • Public • Published

pouchdb-adapter-react-native-leveldb

PouchDB adapter for React Native that uses LevelDB as its backing store. Designed to run in React Native. Its adapter name is react-native-leveldb.

This adapter relies on awesome work with react-native-leveldb that is a high performance standalone database for React Native. Now PouchDB actually fits in your pocket!

  • Faster and more versatile than AsyncStorage and SQLite
    • AsyncStorage has size limits especially in Android
    • SQLite is not a NoSQL store designed to store schemaless documents
  • Almost complete implementation of PouchDB adapter API
    • No support for attachments yet
    • No support for _putLocal, _getLocal and _removeLocal
    • Some shortages on how document revisions are handled (please see TODO comments in code)
  • PouchDB is a perfect fit for mobile applications: you can write data locally and let database sync it automatically to cloud when the connection is available
  • Supports react-native-web for development purposes so that you can test your application in a web browser
  • Fully tested, code coverage ~100%

Usage

Install peer dependency packages pouchdb-core, react-native-leveldb and react-native-get-random-values:

npm install pouchdb-core react-native-leveldb react-native-get-random-values --save

Register the plugin and create a database instance:

PouchDB.plugin(require("pouchdb-adapter-react-native-leveldb"));
const db = new PouchDB("my_db", { adapter: "react-native-leveldb" });

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

Package Sidebar

Install

npm i pouchdb-adapter-react-native-leveldb

Weekly Downloads

3

Version

0.5.0

License

Apache-2.0

Unpacked Size

29.4 kB

Total Files

9

Last publish

Collaborators

  • haamutech