@uwdata/mosaic-sql
Version:
SQL query construction and analysis.
29 lines • 794 B
JavaScript
import { BINARY_OPERATOR } from '../constants.js';
import { ExprNode } from './node.js';
export class BinaryOpNode extends ExprNode {
/** The operator type. */
op;
/** The left input expression. */
left;
/** The right input expression. */
right;
/**
* Instantiate a binary operator node.
* @param op The operator type.
* @param left The left input expression.
* @param right The right input expression.
*/
constructor(op, left, right) {
super(BINARY_OPERATOR);
this.op = op;
this.left = left;
this.right = right;
}
/**
* Generate a SQL query string for this node.
*/
toString() {
return `(${this.left} ${this.op} ${this.right})`;
}
}
//# sourceMappingURL=binary-op.js.map