MCPcopy Index your code
hub / github.com/tinyplex/tinybase / setPersisted

Function setPersisted

src/persisters/common/database/tabular.ts:198–212  ·  view source on GitHub ↗
(
    getContent: () => PersistedContent<Persist>,
    changes?: PersistedChanges<Persist, true>,
  )

Source from the content-addressed store, hash-verified

196 }) as any;
197
198 const setPersisted = (
199 getContent: () => PersistedContent<Persist>,
200 changes?: PersistedChanges<Persist, true>,
201 ): Promise<void> =>
202 transaction(async () => {
203 await refreshSchema();
204 if (!isUndefined(changes)) {
205 await saveTables(changes[0] as any, true);
206 await saveValues(changes[1] as any, true);
207 } else {
208 const [tables, values] = getContent() as any;
209 await saveTables(tables);
210 await saveValues(values);
211 }
212 });
213
214 const destroy = async () => {
215 await persister.stopAutoPersisting();

Callers

nothing calls this directly

Calls 6

isUndefinedFunction · 0.90
refreshSchemaFunction · 0.85
saveTablesFunction · 0.85
saveValuesFunction · 0.85
transactionFunction · 0.70
getContentFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…