MCPcopy Index your code
hub / github.com/simstudioai/sim / shiftRowsUpFrom

Function shiftRowsUpFrom

apps/sim/lib/table/rows/ordering.ts:79–84  ·  view source on GitHub ↗
(trx: DbTransaction, tableId: string, position: number)

Source from the content-addressed store, hash-verified

77
78/** Shifts every row at or after `position` up by one (`position + 1`). */
79export async function shiftRowsUpFrom(trx: DbTransaction, tableId: string, position: number) {
80 await trx
81 .update(userTableRows)
82 .set({ position: sql`position + 1` })
83 .where(and(eq(userTableRows.tableId, tableId), gte(userTableRows.position, position)))
84}
85
86/** Shifts every row after `position` down by one (`position - 1`). */
87export async function shiftRowsDownAfter(trx: DbTransaction, tableId: string, position: number) {

Callers 3

reserveInsertPositionFunction · 0.85
reserveBatchPositionsFunction · 0.85
insertOrderedRowFunction · 0.85

Calls 2

setMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected