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

Function saveTables

src/persisters/common/database/tabular.ts:78–114  ·  view source on GitHub ↗
(
    tables:
      | Tables
      | {
          [tableId: Id]:
            | {[rowId: Id]: {[cellId: Id]: CellOrUndefined} | undefined}
            | undefined;
        },
    partial?: boolean,
  )

Source from the content-addressed store, hash-verified

76 );
77
78 const saveTables = (
79 tables:
80 | Tables
81 | {
82 [tableId: Id]:
83 | {[rowId: Id]: {[cellId: Id]: CellOrUndefined} | undefined}
84 | undefined;
85 },
86 partial?: boolean,
87 ) =>
88 promiseAll(
89 mapMap(
90 tablesSaveConfig,
91 async (
92 [
93 tableName,
94 rowIdColumnName,
95 deleteEmptyColumns,
96 deleteEmptyTable,
97 condition,
98 ],
99 tableId,
100 ) => {
101 if (!partial || objHas(tables, tableId)) {
102 await saveTable(
103 tableName,
104 rowIdColumnName,
105 tables[tableId],
106 deleteEmptyColumns,
107 deleteEmptyTable,
108 partial,
109 condition,
110 );
111 }
112 },
113 ),
114 );
115
116 const getValuesSubset = (
117 values: Values | {[valueId: Id]: ValueOrUndefined},

Callers 1

setPersistedFunction · 0.85

Calls 4

promiseAllFunction · 0.90
mapMapFunction · 0.90
objHasFunction · 0.90
saveTableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…