MCPcopy Create free account
hub / github.com/clientdb/clientdb / fetchInitialData

Function fetchInitialData

engine/server/init.ts:8–22  ·  view source on GitHub ↗
(
  context: SyncRequestContext
)

Source from the content-addressed store, hash-verified

6}
7
8export async function fetchInitialData(
9 context: SyncRequestContext
10): Promise<EntityKindBootData<any>[]> {
11 const { db, schema } = context;
12
13 const bootDataPromises = schema.entities.map(async (entity) => {
14 const items = await db.table(entity.name).select("*");
15 const kind = entity.name;
16 return { kind, items };
17 });
18
19 const bootData = await Promise.all(bootDataPromises);
20
21 return bootData;
22}

Callers 1

createSyncServerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected