-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
It could be great to have the same API, in order to be able to use the app in a WebKit navigator.
Waiting for that, I wrote an adapter :
_executeSqlBridge: function(tx, sql, params, dataHandler, errorHandler) {
var self = this;
if (typeof self.db.dbPath !== 'undefined') {
//this is a native DB, the method signature is different:
var sqlAndParams = [sql].concat(params);
var cb = function(res) {
//in WebSQL : result.rows.item(0)
//in the phonegap plugin : res.rows[0]
res.rows.item = function(i) {
return this[i];
};
//the result callback hasn't the tx param
dataHandler(tx, res);
};
tx.executeSql(sqlAndParams, cb, errorHandler);
} else {
//Standard WebSQL
tx.executeSql(sql, params, dataHandler, errorHandler);
}
},
Metadata
Metadata
Assignees
Labels
No labels