(trx: DbTransaction, tableId: string, position: number)
| 77 | |
| 78 | /** Shifts every row at or after `position` up by one (`position + 1`). */ |
| 79 | export 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`). */ |
| 87 | export async function shiftRowsDownAfter(trx: DbTransaction, tableId: string, position: number) { |
no test coverage detected