Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Express pouchdb with pouchdb apdapter node websql #92

Open
mavericksthinker opened this issue Dec 5, 2018 · 1 comment
Open

Express pouchdb with pouchdb apdapter node websql #92

mavericksthinker opened this issue Dec 5, 2018 · 1 comment

Comments

@mavericksthinker
Copy link

Issue

Unable to implement websql/riak on nodejs cordova android app . Leveldown which is by default is unsupported for platform android.

Info

  • Environment: (Node.js/browser/hybrid app/etc.)
    Hybrid app
  • Platform: (Chrome/FF/Safari/Edge/iOS/Android/etc.)
    Cordova android
  • Adapter: (IndexedDB/WebSQL/LevelDB/etc.)
    Websql/riak
  • Server: (CouchDB/Cloudant/Couchbase/PouchDB Server/etc.)
    Express-pouchdb

Hello , I have a Cordova android app that runs express-pouchdb server in it's backend . I was able to implement memdown which currently stores the data in memory and is lost once the app is restarted . So I tried to implement pouchdb adapter node websql but during the runtime it has error in leveldown.node which is 64bit but requires a 32bit on android . When I rebuilt the leveldown to 32bit it still shows error and leveldown doesnt support android .

Is there a way to change to levelup with websql adapter or help in implementation of levelup riak ? Or is there any better way to make it suitable for production?
Any help will be appreciated.

@mavericksthinker
Copy link
Author

I just want to have information about how to store the data in the express-pouchdb server running in the background of Cordova Android by using Cordova-plugin-nodejs as with normally setting up the server Example:

let app = require('express');
let Pouchdb = require ('pouchdb').;
let inMemPouchdb =Pouchdb.defaults({db: require('memdown'), migrate:false};

let pouchExpress = require ('express-pouchdb')(inMemPouchdb,{mode:'minimumForPouchDB'};
app.use('/',pouch express);
app.listen(3000);
let db = new Pouchdb('db');
db.changes({live :true}).on('change',console.log);

In this case the data syncs and stores but in memory and once the app is restarted all data is lost as it is using memdown(stores in memory) . But I want it to be stored in the server and data won't be lost if the app is restarted. Using leveldown adapter is showing error as the build process fails while running leveldown script . Is there any way I can use any other adapter to store data but not in just memory. Any hint or sample will be deeply appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant