Coder Social home page Coder Social logo

ngomana / pouchdb-react-native-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seigel/pouchdb-react-native

0.0 0.0 0.0 3.15 MB

Pouchdb with async storage

License: MIT License

JavaScript 85.97% Java 1.93% Objective-C 6.88% Shell 2.67% Starlark 2.56%

pouchdb-react-native-1's Introduction

Logo

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

NEWS

Hello! Welcome to pouchdb-react-native. I am James and have been lucky enough to been entrusted with the care and feeding of this repository. I am going to work on getting it functional again with the latest pouchdb AND react native versions using a little help from @craftzdog's work to fill the the gaps. Please be patient and offer bug reports and patches through the Issues system here. I am just getting my feet settled. Looking forward to working with you.

Cheers

pouchdb-react-native

PouchDB, the React Native-only edition. A preset representing the PouchDB code that runs in React Native.

The pouchdb-react-native preset contains the version of PouchDB that is designed for React Native. In particular, it ships with the AsyncStorage adapter as its default adapter. 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 pouchdb-react-native@next --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/seigel/pouchdb-react-native/tree/master/example

pouchdb-adapter-asyncstorage

PouchDB adapter using AsyncStorage as its data store. Designed to run in React Native. 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. Currently, there is work being done on them. See (seigel#68)

Development

git clone https://github.com/seigel/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

pouchdb-react-native-1's People

Contributors

stockulus avatar dependabot[bot] avatar seigel avatar jurassix avatar ewnd9 avatar greenkeeperio-bot avatar jaredly avatar ratson avatar mlecoq avatar ddolheguy avatar patriciagarcia avatar pdehaan avatar rodrigoelp avatar aanchan avatar adventure-yunfei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.