UNPKG

sedk-mysql

Version:
26 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteFromStep = void 0; const database_1 = require("../../database"); const BaseStep_1 = require("../BaseStep"); const DeleteConditionStep_1 = require("./DeleteConditionStep"); class DeleteFromStep extends BaseStep_1.BaseStep { constructor(prevStep, fromItem) { super(prevStep); this.fromItem = fromItem; } getStepStatement(artifacts = { tables: new Set(), columns: new Set() }) { return 'FROM ' + this.fromItem.getStmt(this.data, artifacts); } getStepArtifacts() { const table = this.fromItem instanceof database_1.Table ? this.fromItem : this.fromItem.table; return { tables: new Set([table]), columns: new Set() }; } where(cond1, op1, cond2, op2, cond3) { const whereParts = []; BaseStep_1.BaseStep.addConditionParts(whereParts, cond1, op1, cond2, op2, cond3); return new DeleteConditionStep_1.DeleteWhereStep(this, whereParts); } } exports.DeleteFromStep = DeleteFromStep; //# sourceMappingURL=DeleteFromStep.js.map