sedk-mysql
Version:
Simple SQL builder and validator for MySQL
40 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HavingOrStep = exports.HavingAndStep = exports.HavingStep = void 0;
const ConditionStep_1 = require("../ConditionStep");
const BaseStep_1 = require("../BaseStep");
const OrderByStep_1 = require("./OrderByStep");
class HavingConditionStep extends ConditionStep_1.ConditionStep {
and(cond1, op1, cond2, op2, cond3) {
const havingParts = [];
BaseStep_1.BaseStep.addConditionParts(havingParts, cond1, op1, cond2, op2, cond3);
return new HavingAndStep(this, havingParts);
}
or(cond1, op1, cond2, op2, cond3) {
const havingParts = [];
BaseStep_1.BaseStep.addConditionParts(havingParts, cond1, op1, cond2, op2, cond3);
return new HavingOrStep(this, havingParts);
}
orderBy(...orderByItems) {
return new OrderByStep_1.OrderByStep(this, orderByItems);
}
}
class HavingStep extends HavingConditionStep {
constructor(step, havingParts) {
super('HAVING', step, havingParts);
}
}
exports.HavingStep = HavingStep;
class HavingAndStep extends HavingConditionStep {
constructor(step, havingParts) {
super('AND', step, havingParts);
}
}
exports.HavingAndStep = HavingAndStep;
class HavingOrStep extends HavingConditionStep {
constructor(step, havingParts) {
super('OR', step, havingParts);
}
}
exports.HavingOrStep = HavingOrStep;
//# sourceMappingURL=HavingStep.js.map