Are there any document repositories for responding to family?

It would be great to have something similar to PouchDB .

The current key memory ( AsyncStorage ) is definitely not enough to store and query data.

+8
pouchdb react-native
source share
5 answers

You can use asyncstorage-down with PouchDB. Typically, the method for using LevelDOWN adapters in Node.js looks like this:

 var PouchDB = require('pouchdb'); var db = new PouchDB('mydb', {db: require('asyncstorage-down')}) 

I have not tested this.

Edit: you're in luck; there has been a lot of work lately : pouchdb-async-storage . Expect a blog post soon on how to do this.

+6
source share

PouchDB is built for the browser, so it can probably work with React Native with little effort.

Have you seen https://github.com/almost/react-native-sqlite ?

+1
source share

I am having some problems getting PouchDB running on native-native but didn't want to install SQLLite. Therefore, I am creating an Async storage adapter.

Github npm

It Poly fills in missing packages for React +. Added asynchronous storage adapter base to "asyncstorage-down". Correctly this helps.

+1
source share

I tried using the Stockulus asynchronous storage adapter ( https://github.com/stockulus/pouchdb-react-native ), but there were problems replicating to the remote CouchDB server.

Now I am using React native SQLite Storage ( https://github.com/andpor/react-native-sqlite-storage ) and the PouchDB custom assembly template ( https://pouchdb.com/2016/06/06/introducing-pouchdb- custom-builds.html ) as follows:

 'use strict'; import PouchDB from 'pouchdb-core' // POLYFILLS - adapted from https://github.com/pouchdb/pouchdb/issues/3787#issuecomment-234618747 global.Buffer = global.Buffer || require('buffer').Buffer; global.atob = global.atob || require('atob'); global.btoa = global.btoa || require('btoa'); require('blob-polyfill'); import SQLite from 'react-native-sqlite-storage'; global.openDatabase = SQLite.openDatabase; // Expose for websql adapter GLOBAL.openDatabase = SQLite.openDatabase; PouchDB .plugin(require('pouchdb-adapter-websql')) .plugin(require('pouchdb-adapter-http')) .plugin(require('pouchdb-replication')) export default PouchDB 

I know that global ugliness. We just started using it, and replication works better. We also had to polyfill a bunch of node things. This is used by pouchdb-core, but is not indicated as a dependency in pouchdb-core. Will feedback be interesting.

Currently, the following packages are used:

 "events": "^1.1.1", "pouchdb-adapter-http": "6.0.6", "pouchdb-adapter-websql": "6.0.6", "pouchdb-core": "6.0.6", "pouchdb-replication": "6.0.6", "atob": "^2.0.3", "blob-polyfill": "^1.0.20150320", "btoa": "^1.1.2", "buffer": "^5.0.0", 

thanks

+1
source share

You can easily implement PouchDB on top of SQLLite - it has several configuration options. You may need the SQLite plugin to make it work. I actually did it for Cordoba, and it worked pretty well. I believe that PouchDB (which is pure JavaScript and therefore can be used from ready-to-use for ReactNative) has an adapter that works with the full-featured SQLite3 plugin.

React The original version of this plugin is available here:

https://github.com/andpor/react-native-sqlite-storage

The original Cordova plugin link is also in the github project.

0
source share