kloudglue-alasql
Version:
Versatile SQL database for browser or node. Handles relational data and nested JSON (noSQL). Export to and import from Excel, localStorage or IndexedDB
18 lines (15 loc) • 454 B
JavaScript
// Plugin sample
var yy = alasql.yy;
yy.Echo = function (params) { return yy.extend(this, params); }
yy.Echo.prototype.toString = function() {
var s = 'TEST '+this.expr.toString();
return s;
}
yy.Echo.prototype.execute = function (databaseid, params, cb) {
// var self = this;
// console.log(this.expr.toJS());
var fn = new Function('params, alasql','return '+this.expr.toJS());
var res = fn(params, alasql);
if(cb) res = cb(res);
return res;
}