alasql
Version:
AlaSQL.js - JavaScript SQL database library for relational and graph data manipulation with support of localStorage, IndexedDB, and Excel
31 lines (28 loc) • 611 B
JavaScript
/*
//
// HELP for Alasql.js
// Date: 03.11.2014
// (c) 2014, Andrey Gershun
//
*/
yy.Source = function (params) { return yy.extend(this, params); }
yy.Source.prototype.toString = function() {
var s = K('SOURCE');
if(this.url) s += ' '+S('\''+this.url+'\'');
return s;
}
// SOURCE FILE
yy.Source.prototype.execute = function (databaseid,params,cb) {
// console.log(this.url);
var res;
loadFile(this.url, !!cb, function(data){
// console.log(data);
// res = 1;
res = alasql(data);
if(cb) res = cb(res);
return res;
}, function(err){
throw err;
});
return res;
};