hedera-web/js/sql/stmt.js

41 lines
601 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2022-05-30 01:30:33 +00:00
var Object = require('./object');
var Expr = require('./expr');
2016-09-26 09:28:47 +00:00
/**
* The equivalent of a SQL statement.
2022-05-26 06:08:31 +00:00
*/
2022-05-30 01:30:33 +00:00
module.exports = new Class({
2016-09-26 09:28:47 +00:00
Extends: Object
2022-05-30 01:30:33 +00:00
,Properties: {
where: {
2016-09-26 09:28:47 +00:00
type: Expr
,value: null
2022-05-30 01:30:33 +00:00
},
limit: {
type: Number
,value: null
}
}
,target: []
2022-11-16 01:46:44 +00:00
,addTarget(target) {
2022-05-30 01:30:33 +00:00
this.target.push(target);
}
2022-11-16 01:46:44 +00:00
,renderTarget(params) {
2022-05-30 01:30:33 +00:00
if (this.target.length > 0)
return ' '+ this.renderListWs(this.target, params, ', ');
else
2022-05-30 01:30:33 +00:00
return ' DUAL';
}
2022-11-16 01:46:44 +00:00
,renderLimit() {
2022-05-30 01:30:33 +00:00
if (this.limit != null)
return ' LIMIT '+ parseInt(this.limit);
else
return '';
}
});