sedk-mysql
Version:
Simple SQL builder and validator for MySQL
24 lines • 971 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetStep = void 0;
const BaseStep_1 = require("../BaseStep");
const UpdateConditionStep_1 = require("./UpdateConditionStep");
class SetStep extends BaseStep_1.BaseStep {
constructor(prevStep, items) {
super(prevStep);
this.items = items;
}
getStepStatement(artifacts = { tables: new Set(), columns: new Set() }) {
return `SET ${this.items.map(it => it.getStmt(this.data, artifacts, this.binderStore)).join(', ')}`;
}
getStepArtifacts() {
return { tables: new Set(), columns: new Set(this.items.map(it => it.column)) };
}
where(cond1, op1, cond2, op2, cond3) {
const whereParts = [];
BaseStep_1.BaseStep.addConditionParts(whereParts, cond1, op1, cond2, op2, cond3);
return new UpdateConditionStep_1.UpdateWhereStep(this, whereParts);
}
}
exports.SetStep = SetStep;
//# sourceMappingURL=SetStep.js.map