plywood
Version:
A query planner and executor
32 lines (31 loc) • 1.18 kB
JavaScript
import { __extends } from "tslib";
import { ChainableExpression, Expression } from './baseExpression';
var NotExpression = (function (_super) {
__extends(NotExpression, _super);
function NotExpression(parameters) {
var _this = _super.call(this, parameters, dummyObject) || this;
_this._ensureOp('not');
_this._checkOperandTypes('BOOLEAN');
_this.type = 'BOOLEAN';
return _this;
}
NotExpression.fromJS = function (parameters) {
return new NotExpression(ChainableExpression.jsToValue(parameters));
};
NotExpression.prototype._calcChainableHelper = function (operandValue) {
return !operandValue;
};
NotExpression.prototype._getSQLChainableHelper = function (dialect, operandSQL) {
return "(".concat(operandSQL, ") IS NOT TRUE");
};
NotExpression.prototype.specialSimplify = function () {
var operand = this.operand;
if (operand instanceof NotExpression)
return operand.operand;
return this;
};
NotExpression.op = 'Not';
return NotExpression;
}(ChainableExpression));
export { NotExpression };
Expression.register(NotExpression);