2016-09-26 09:28:47 +00:00
|
|
|
|
|
|
|
var Stmt = require ('./stmt');
|
|
|
|
var Value = require ('./value');
|
|
|
|
var Field = require ('./field');
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
|
|
|
* The equivalent of a SQL DML.
|
|
|
|
**/
|
2016-09-26 09:28:47 +00:00
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Stmt
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
,field: []
|
|
|
|
,expr: []
|
|
|
|
|
|
|
|
,addSet: function (fieldName, value)
|
|
|
|
{
|
2016-09-26 09:28:47 +00:00
|
|
|
this.expr.push (new Value ({value: value}));
|
|
|
|
this.field.push (new Field ({name: fieldName}));
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
2015-03-19 19:36:11 +00:00
|
|
|
,addExpr: function (fieldName, expr)
|
|
|
|
{
|
|
|
|
this.expr.push (expr);
|
2016-09-26 09:28:47 +00:00
|
|
|
this.field.push (new Field ({name: fieldName}));
|
2015-03-19 19:36:11 +00:00
|
|
|
}
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
,delSet: function ()
|
|
|
|
{
|
|
|
|
this.field.splice (0, this.field.length);
|
|
|
|
this.expr.splice (0, this.expr.length);
|
|
|
|
}
|
|
|
|
});
|