kysely-mapper
Version:
Flexible Kysely-based utility for mapping between tables and objects
25 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnyColumnsMappingUpdateQuery = void 0;
const update_query_js_1 = require("./update-query.js");
const subsetting_update_query_js_1 = require("./subsetting-update-query.js");
/**
* Mapping query for updating rows from a database table, where the
* columns to be updated have not been restricted.
*/
class AnyColumnsMappingUpdateQuery extends update_query_js_1.MappingUpdateQuery {
constructor(db, qb, transforms, returnColumns) {
super(db, qb, transforms, returnColumns);
}
/**
* Returns a mapping query that only updates a specified subset of columns.
* @param columns The columns to update. All are required, but this
* constraint is only enforced at runtime, not by the type system.
* @returns A mapping query that only updates the specified columns.
*/
columns(columnsToUpdate) {
return new subsetting_update_query_js_1.SubsettingMappingUpdateQuery(this.db, this.qb, columnsToUpdate, this.transforms, this.returnColumns);
}
}
exports.AnyColumnsMappingUpdateQuery = AnyColumnsMappingUpdateQuery;
//# sourceMappingURL=any-update-query.js.map