MCPcopy
hub / github.com/remix-run/remix / updateMany

Method updateMany

packages/data-table/src/lib/database.ts:665–687  ·  view source on GitHub ↗
(
    table: table,
    changes: Partial<TableRow<table>>,
    options: UpdateManyOptions<table>,
  )

Source from the content-addressed store, hash-verified

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,

Callers 7

adapter.test.tsFile · 0.80
database.test.tsFile · 0.80
adapter.test.tsFile · 0.80

Calls 9

queryMethod · 0.95
asQueryTableInputFunction · 0.90
normalizeOrderByInputFunction · 0.90
toWriteResultFunction · 0.90
whereMethod · 0.80
orderByMethod · 0.80
offsetMethod · 0.80
limitMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected