jasonkneen / RESTe

A simple JavaScript REST / API helper for Titanium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to use RESTe for local sqlite DB Storage?

adamtarmstrong opened this issue · comments

Experimenting here.... Using RESTe has spoiled me when it comes to the ease of use for models, methods and collections.

Reading through AppC doc on how to use sqlite db and sync adapters - it referenced:
// Since the urlRoot attribute is defined, all HTTP commands are to /library
var Book = Backbone.Model.extend({urlRoot:'/library'})

And it got me wandering - is it possible to do something similar in the standard RESTe config parameter "url" and keep all calls local to device/db? Then I could create methods to do CRUD against the DB.

Not knowing the magic behind RESTe - I was just curious if you've tried this or had any suggestions in regards to going down this path.

Thanks - absolutely LOVE 💯 this library!!
Adam.

You could use it by using mock collections -- so use reste.createCollection to create one from an array and then that would work -- read from DB > createCollection and then render.