MCPcopy
hub / github.com/microsoft/data-formulator / loadAll

Function loadAll

src/app/workspaceDB.ts:217–227  ·  view source on GitHub ↗

Load ALL table rows for a workspace (for sending to server).

(workspaceId: string)

Source from the content-addressed store, hash-verified

215
216 /** Load ALL table rows for a workspace (for sending to server). */
217 async loadAll(workspaceId: string): Promise<{ name: string; rows: any[] }[]> {
218 const db = await openDB();
219 try {
220 const store = txStore(db, 'readonly', STORE_TABLE_DATA);
221 const index = store.index('workspaceId');
222 const entries: TableDataEntry[] = await reqToPromise(index.getAll(workspaceId));
223 return entries.map(e => ({ name: e.tableId, rows: e.rows }));
224 } finally {
225 db.close();
226 }
227 },
228
229 /** Delete one table's data. */
230 async delete(workspaceId: string, tableId: string): Promise<void> {

Callers

nothing calls this directly

Calls 4

openDBFunction · 0.85
txStoreFunction · 0.85
reqToPromiseFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected