* Materialize tables using the shared listTables function. * Returns a summary for WORKSPACE.md generation.
(workspaceId: string)
| 1491 | * Returns a summary for WORKSPACE.md generation. |
| 1492 | */ |
| 1493 | private async materializeTables(workspaceId: string): Promise<WorkspaceMdData['tables']> { |
| 1494 | try { |
| 1495 | const tables = await listTables(workspaceId) |
| 1496 | |
| 1497 | for (const table of tables) { |
| 1498 | const safeName = sanitizeName(table.name) |
| 1499 | this.files.set( |
| 1500 | `tables/${safeName}/meta.json`, |
| 1501 | serializeTableMeta({ |
| 1502 | id: table.id, |
| 1503 | name: table.name, |
| 1504 | description: table.description, |
| 1505 | schema: table.schema, |
| 1506 | rowCount: table.rowCount, |
| 1507 | maxRows: table.maxRows, |
| 1508 | createdAt: table.createdAt, |
| 1509 | updatedAt: table.updatedAt, |
| 1510 | }) |
| 1511 | ) |
| 1512 | } |
| 1513 | |
| 1514 | return tables.map((t) => ({ |
| 1515 | id: t.id, |
| 1516 | name: t.name, |
| 1517 | description: t.description, |
| 1518 | rowCount: t.rowCount, |
| 1519 | })) |
| 1520 | } catch (err) { |
| 1521 | logger.warn('Failed to materialize tables', { |
| 1522 | workspaceId, |
| 1523 | error: toError(err).message, |
| 1524 | }) |
| 1525 | return [] |
| 1526 | } |
| 1527 | } |
| 1528 | |
| 1529 | /** |
| 1530 | * Materialize workspace files (already uses listWorkspaceFiles). |
no test coverage detected