forked from AlaSQL/alasql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
36,362 additions
and
36,348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,5 +57,5 @@ | |
"bin", | ||
"lib" | ||
], | ||
"version": "0.4.10" | ||
"version": "0.4.11" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// 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(76336,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; | ||
// 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(76336,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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
// Prolog plugin | ||
|
||
var yy = alasql.yy; | ||
|
||
yy.Term = function (params) { return yy.extend(this, params); } | ||
yy.Term.prototype.toString = function() { | ||
var s = this.termid; | ||
if(this.args && this.args.length > 0) { | ||
s += '('+this.args.map(function(arg){ | ||
return arg.toString(); | ||
})+')'; | ||
} | ||
return s; | ||
}; | ||
|
||
yy.AddRule = function (params) { return yy.extend(this, params); } | ||
yy.AddRule.prototype.toString = function() { | ||
var s = ''; | ||
if(this.left) s += this.left.toString(); | ||
s += ':-'; | ||
s += this.right.map(function(r){return r.toString()}).join(','); | ||
return s; | ||
}; | ||
|
||
yy.AddRule.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); | ||
var res = 1; | ||
var objects = alasql.databases[databaseid].objects; | ||
var rule = {}; | ||
if(!this.left) { | ||
this.right.forEach(function(term){ | ||
rule.$class = term.termid; | ||
}); | ||
} | ||
if(cb) res = cb(res); | ||
return res; | ||
// Prolog plugin | ||
|
||
var yy = alasql.yy; | ||
|
||
yy.Term = function (params) { return yy.extend(this, params); } | ||
yy.Term.prototype.toString = function() { | ||
var s = this.termid; | ||
if(this.args && this.args.length > 0) { | ||
s += '('+this.args.map(function(arg){ | ||
return arg.toString(); | ||
})+')'; | ||
} | ||
return s; | ||
}; | ||
|
||
yy.AddRule = function (params) { return yy.extend(this, params); } | ||
yy.AddRule.prototype.toString = function() { | ||
var s = ''; | ||
if(this.left) s += this.left.toString(); | ||
s += ':-'; | ||
s += this.right.map(function(r){return r.toString()}).join(','); | ||
return s; | ||
}; | ||
|
||
yy.AddRule.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); | ||
var res = 1; | ||
var objects = alasql.databases[databaseid].objects; | ||
var rule = {}; | ||
if(!this.left) { | ||
this.right.forEach(function(term){ | ||
rule.$class = term.termid; | ||
}); | ||
} | ||
if(cb) res = cb(res); | ||
return res; | ||
}; |
Oops, something went wrong.