sedk-postgres
Version:
Simple SQL builder and validator
54 lines • 1.86 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 OffsetStep_1 = require("./OffsetStep");
const LimitStep_1 = require("./LimitStep");
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);
}
limit(n) {
return new LimitStep_1.LimitStep(this, n);
}
limit$(n) {
return new LimitStep_1.LimitStep(this, n, true);
}
offset(n) {
return new OffsetStep_1.OffsetStep(this, n);
}
offset$(n) {
return new OffsetStep_1.OffsetStep(this, n, true);
}
}
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