(tableId: string)
| 75 | } |
| 76 | |
| 77 | async function readRowsVersion(tableId: string): Promise<number> { |
| 78 | const [row] = await db |
| 79 | .select({ rowsVersion: userTableDefinitions.rowsVersion }) |
| 80 | .from(userTableDefinitions) |
| 81 | .where(eq(userTableDefinitions.id, tableId)) |
| 82 | .limit(1) |
| 83 | if (!row) throw new Error(`Table ${tableId} not found while reading rows_version`) |
| 84 | return row.rowsVersion |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Streams the table CSV (keyset-paginated, like the export worker) into storage under `key`, |
no test coverage detected