kysely-mapper
Version:
Flexible Kysely-based utility for mapping between tables and objects
21 lines • 957 B
JavaScript
import { MappingUpdateQuery } from './update-query.js';
import { SubsettingMappingUpdateQuery } from './subsetting-update-query.js';
/**
* Mapping query for updating rows from a database table, where the
* columns to be updated have not been restricted.
*/
export class AnyColumnsMappingUpdateQuery extends 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 SubsettingMappingUpdateQuery(this.db, this.qb, columnsToUpdate, this.transforms, this.returnColumns);
}
}
//# sourceMappingURL=any-update-query.js.map