MCPcopy
hub / github.com/tinyplex/tinybase / getNewRowId

Function getNewRowId

src/store/index.ts:869–876  ·  view source on GitHub ↗
(tableId: Id, reuse: 0 | 1)

Source from the content-addressed store, hash-verified

867 );
868
869 const getNewRowId = (tableId: Id, reuse: 0 | 1): Id => {
870 const [getId] = mapGet(tablePoolFunctions, tableId) as PoolFunctions;
871 let rowId;
872 do {
873 rowId = getId(reuse);
874 } while (collHas(mapGet(tablesMap, tableId), rowId));
875 return rowId;
876 };
877
878 const getOrCreateTable = (tableId: Id) =>
879 mapEnsure(tablesMap, tableId, () => {

Callers 1

addRowFunction · 0.70

Calls 2

mapGetFunction · 0.90
collHasFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…