(tableId: string, schema: TableSchema)
| 131 | |
| 132 | /** Overwrites a table's schema during an import (used when inferring columns from the file). */ |
| 133 | export async function setTableSchemaForImport(tableId: string, schema: TableSchema): Promise<void> { |
| 134 | await db |
| 135 | .update(userTableDefinitions) |
| 136 | .set({ schema, updatedAt: new Date() }) |
| 137 | .where(eq(userTableDefinitions.id, tableId)) |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Owns the append-import transaction so the API route never holds a `trx`: |
no test coverage detected