Use of SQLite tables and queries as datasource alongside services datasources is useful when developing ios / android apps. Apps can work local, without internet conection.
Use of SQLite tables and queries as datasource alongside services datasources is useful when developing ios / android apps. Apps can work local, without internet conection.
As SQLite is included in supporting browsers, you can use it today by simply using the available JavaScript API (for example, via Custom JavaScript action: http://help.gotiggr.com/documentation...)
We do have plans to add visual tools to make it simpler to work with such sources. It may be something like we have today for REST services.
One thing to note is that Web SQL Database specification is no longer active (but still supported by browser): http://www.w3.org/TR/webdatabase/ . There is now a new specification: IndexedDB, http://www.w3.org/TR/IndexedDB/
Ok thanks. That's great.
"We do have plans to add visual tools to make it simpler to work with such sources. It may be something like we have today for REST services."
Any status of IndexedDB would be really help.
IndexedDB is a browser feature so if you run your app in a browser that supports it, you can use it today. Tiggzi creates standard HTML5 mobile apps, you can use IndexedDB API.
What would be a huge improvement to the tool would be if we can add service (just like with Tiggzi db) but for local db.
I have been working with code like this:
db.transaction(function(tx) {
var db = window.openDatabase("BMU", "", "BackMeUp", 1024*1000);
tx.executeSql('CREATE TABLE IF NOT EXISTS Events(id INTEGER PRIMARY KEY, idEX INTEGER UNIQUE, catid INTEGER, catidEX INTEGER, title TEXT, location TEXT, startdate DATETIME, enddate DATETIME, buyin INTEGER, created DATETIME)', []);
});
Now would be cool if we can make a select on this local db and map results using the data mapper.
If you can format the response as JSON, you could use Generic Service and use the Data Mapper editor.
I think I am close to have a very nice online/offline db solution. On two missing links I would like to ask you what is the best way to go.
As you can see above I create a local db table called events. At loading of the app I make a call to my Tiggzi db to get Events stores in database. As an Example I retrieve:
[{"createdAt":"2012-08-07 05:42:26.665","id":"50210d32e4b0f5f0d85b1a1e","updatedAt":"2012-08-28 06:16:59.067","buyin":"300","category":"50210c17e4b0f5f0d85b1a1b","enddate":"2012-02-09 16:00","location":"Eindhoven","startdate":"2012-02-09 16:00","title":"300 EU Freeze-out","userid":"503b8c8be4b059adf7c4a474"},{"createdAt":"2012-08-07 05:43:54.356","id":"50210d8ae4b0f5f0d85b1a1f","updatedAt":"2012-08-28 06:17:02.545","buyin":"250","category":"50210c17e4b0f5f0d85b1a1b","enddate":"2012-02-11 04:00","location":"Eindhoven","startdate":"2012-02-10 16:00","title":"250 EU Freeze-out","userid":"503b8c8be4b059adf7c4a474"}]
It is easy to map this to elements, but for my app I want to store these items to the local db table Events. How can I use the response from the call in some javascript file to make the inserts.
Regarding your answer above to retrieve data from local storage en display in Tiggzi elements. As you stated I must return in JSON format, that shouldn't be a problem. But how must I configure the Rest service element to retrieve from ist own. What will be url to use?
I would be very greatfull for your help.
Let me know if this example helps: https://getsatisfaction.com/tiggzi/to...
Hi Rutger,
Very interesting.. Are you building solution generically or specifically in your application. Could this be packaged in form of library (or code example in worst case)?
Unmesh