Couchbase Lite start locally

Viewed 327

I use PhoneGap and I would like to avoid starting/working with an Android Emulator but be simply in browser and work with Couchbase Lite as if I was on device.

I mean, I want to create/start a database, put some data there to see how it works, and then push/start it to/on device.

So, I would like to start Couchbase Lite locally on my laptop to make it receive http calls from my web app.

But since 'Lite' means 'embedded' to a device, there is a question: is it possible to launch it on my laptop but not on device or an emulator?

I understand that I could mock any http response that Couchbase Lite could provide me back on my ajax-requests but I don't know what it can and cannot do, so I need to work with real data for now.

For example if I had used SQL it would not be a problem, since I can install SQLite on Android as well as on Laptop. I may avoid using simulator, being on my browser on my Laptop.

And general question: what is the best practice how to work with Couchbase Lite on local machine to test all stuff instead of wasting time playing with emulator?

2 Answers

You are kind of mixing apples and oranges here. SQL is a language standard with many implementations. Among those are SQLite on OSX and SQLite on Android, and, for instance MySQL, on Linux and Postgres on Windows.

Couchbase is an implementation of an open (but not a broad standard) NoSQL API. You interact with it using bindings for your particular implementation language, not by embedding the standard query language (SQL) in strings.

Couchbase goes to a lot of trouble to keep its language bindings similar from one language to another. That said, the whole point is that they are bindings for different languages. They are, inevitably, slightly different. The Android bindings depend on Context, the Android file system, Looper and so on. They cannot be used except in an Android environment.

That said, the bindings are just the icing on the cake. The underlying database engine is the same for all Couchbase-lite products. The code you use in your browser will not be portable. The databases you build, however, are portable and the general structure of the code you write should be very, very similar.

Related