MCPcopy Create free account
hub / github.com/tinyplex/tinybase / summarizeBatch

Function summarizeBatch

test/unit/persisters/powersync.test.ts:38–51  ·  view source on GitHub ↗
(
  powerSync: PowerSyncDatabase,
)

Source from the content-addressed store, hash-verified

36};
37
38const summarizeBatch = async (
39 powerSync: PowerSyncDatabase,
40): Promise<[CrudSummary[], (() => Promise<void>)?]> => {
41 const batch = await powerSync.getCrudBatch();
42 return [
43 batch?.crud.map(({op, table, id, opData}) => ({
44 op,
45 table,
46 id,
47 opData,
48 })) ?? [],
49 batch?.complete,
50 ];
51};
52
53const completeNextBatch = async (powerSync: PowerSyncDatabase) =>
54 (await summarizeBatch(powerSync))[1]?.();

Callers 2

completeNextBatchFunction · 0.85
powersync.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…