Couchbase Lite using phonegap plugin


#1

Hello Experts, I’m new to CBLite and Cordova/Phone development. I’m able to get the url of running instance of CBLite using javascript cordova app.

However can someone provide me “Hello world” example on how to create a new DB, do a put and get a document onto CBLite database using phonegap plugin.

BTW I have gone though the “todolite” sample app too, but it too convoluted and it blends server and client logic.


#2

Coax is just doing REST / XHR requests. We are planning to rewrite this example using raw jQuery. For now the best thing to do is look at the usage here to better understand the calls it is making in todolite. You can make those calls with any Ajax library, if you like. Coax is just a tool for managing URL paths as JavaScript data structures and making XHR requests. So you can replace it with whatever you like.


#3

Thanks for the suggestion.

In fact I had started trying it using direct REST calls, you have validated it.

So do you suggest direct REST call over coax or it does not matter, mainly from maintainability point of view.

I also would like to know if there are any drawbacks of using Phonegap plugin vis-a-vis Native API?


#4

The main problem with the PhoneGap path is that it can be a pain to debug (although Safari dev tools help a lot).

I would only use coax if you enjoy it, otherwise use your own XHR wrapper.


#5

@jchrisa is this below feasible in using COAX?
Attachments Store/Retrieve as URL
Setup: CBL+ Cordova + COAX
https://github.com/nolanlawson/cordova-plugin-sqlite-2/issues/31