hedera-web/js/sql/stmt.js

48 lines
597 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
var Object = require ('./object');
var Expr = require ('./expr');
/**
* The equivalent of a SQL statement.
**/
2016-09-26 09:28:47 +00:00
module.exports = new Class
({
2016-09-26 09:28:47 +00:00
Extends: Object
,Properties:
{
where:
{
2016-09-26 09:28:47 +00:00
type: Expr
,value: null
}
}
,target: []
,addTarget: function (target)
{
this.target.push (target);
}
,renderTarget: function (batch)
{
var sql;
var len = this.target.length;
if (len > 0)
{
sql = ' ';
for (var n = 0; n < len; n++)
{
if (n > 0) sql += ', ';
sql += this.target[n].render (batch);
}
}
else
sql += 'DUAL';
return sql;
}
});