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

Function setPersisted

src/persisters/common/database/json.ts:61–77  ·  view source on GitHub ↗
(
    getContent: () => PersistedContent<Persist>,
  )

Source from the content-addressed store, hash-verified

59 });
60
61 const setPersisted = (
62 getContent: () => PersistedContent<Persist>,
63 ): Promise<void> =>
64 transaction(async () => {
65 await refreshSchema();
66 await saveTable(
67 storeTableName,
68 storeIdColumnName,
69 {
70 [SINGLE_ROW_ID]: {
71 [storeColumnName]: jsonStringWithUndefined(getContent() ?? null),
72 },
73 },
74 true,
75 true,
76 );
77 });
78
79 const destroy = async () => {
80 await persister.stopAutoPersisting();

Callers 1

saveFunction · 0.50

Calls 5

jsonStringWithUndefinedFunction · 0.90
refreshSchemaFunction · 0.85
saveTableFunction · 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…