(
table: table,
changes: Partial<TableRow<table>>,
options: UpdateManyOptions<table>,
)
| 663 | } |
| 664 | |
| 665 | async updateMany<table extends AnyTable>( |
| 666 | table: table, |
| 667 | changes: Partial<TableRow<table>>, |
| 668 | options: UpdateManyOptions<table>, |
| 669 | ): Promise<WriteResult> { |
| 670 | let query: QueryForTable<table> = this.query(asQueryTableInput(table)).where(options.where) |
| 671 | let orderBy = normalizeOrderByInput(options.orderBy) |
| 672 | |
| 673 | for (let [column, direction] of orderBy) { |
| 674 | query = query.orderBy(column, direction) |
| 675 | } |
| 676 | |
| 677 | if (options.limit !== undefined) { |
| 678 | query = query.limit(options.limit) |
| 679 | } |
| 680 | |
| 681 | if (options.offset !== undefined) { |
| 682 | query = query.offset(options.offset) |
| 683 | } |
| 684 | |
| 685 | let result = await query.update(changes, { touch: options.touch }) |
| 686 | return toWriteResult(result) |
| 687 | } |
| 688 | |
| 689 | async delete<table extends AnyTable>( |
| 690 | table: table, |
no test coverage detected