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

Function addRow

src/store/index.ts:1599–1612  ·  view source on GitHub ↗
(tableId: Id, row: Row, reuseRowIds = true)

Source from the content-addressed store, hash-verified

1597 );
1598
1599 const addRow = (tableId: Id, row: Row, reuseRowIds = true): Id | undefined =>
1600 transaction(() => {
1601 let rowId: Id | undefined = undefined;
1602 if (validateRow(tableId, rowId, row)) {
1603 tableId = id(tableId);
1604 setValidRow(
1605 tableId,
1606 getOrCreateTable(tableId),
1607 (rowId = getNewRowId(tableId, reuseRowIds ? 1 : 0)),
1608 row,
1609 );
1610 }
1611 return rowId;
1612 });
1613
1614 const setPartialRow = (tableId: Id, rowId: Id, partialRow: Row): Store =>
1615 fluentTransaction(

Callers

nothing calls this directly

Calls 6

idFunction · 0.90
transactionFunction · 0.70
validateRowFunction · 0.70
setValidRowFunction · 0.70
getOrCreateTableFunction · 0.70
getNewRowIdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…