UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

26 lines (24 loc) 611 B
import { SqlQuery } from "./chunk-55SDDPJZ.mjs"; import { toClause } from "./chunk-OKPGJD64.mjs"; import { ifGet } from "./chunk-SJGQU3OG.mjs"; // src/sql/Update.ts var Update = class extends SqlQuery { constructor(table, fields) { super(table); this.table = table; this.fields = fields; } toString() { return `UPDATE ${this.table} SET ${Object.entries(this.fields).map(([k, v]) => toClause(k, "=", v)).join(", ")} OUTPUT INSERTED.*` + ifGet(this.clauses.length, ` WHERE ${this.clauses.join(" AND ")};`, ";"); } }; export { Update }; //# sourceMappingURL=chunk-FD7AIHNO.mjs.map