hedera-web/js/sql/dml.js

30 lines
543 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2022-05-28 19:27:36 +00:00
var Stmt = require('./stmt');
var Value = require('./value');
var Field = require('./field');
2016-09-26 09:28:47 +00:00
/**
* The equivalent of a SQL DML.
2022-05-26 06:08:31 +00:00
*/
2022-05-28 19:27:36 +00:00
module.exports = new Class({
2016-09-26 09:28:47 +00:00
Extends: Stmt
,field: []
,expr: []
2022-11-16 01:46:44 +00:00
,addSet(fieldName, value) {
2022-05-28 19:27:36 +00:00
this.field.push(new Field({name: fieldName}));
2022-05-30 01:30:33 +00:00
this.expr.push(new Value({value: value}));
}
2022-11-16 01:46:44 +00:00
,addExpr(fieldName, expr) {
2022-05-28 19:27:36 +00:00
this.field.push(new Field({name: fieldName}));
2022-05-30 01:30:33 +00:00
this.expr.push(expr);
}
2022-11-16 01:46:44 +00:00
,delSet() {
2022-05-28 19:27:36 +00:00
this.field.splice(0, this.field.length);
this.expr.splice(0, this.expr.length);
}
});