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

Function select

src/queries/index.ts:394–419  ·  view source on GitHub ↗
(
            arg1:
              | true
              | Id
              | ((getTableCell: GetTableCell, rowId: Id) => CellOrUndefined),
            arg2?: Id,
            arg3?: Id,
          )

Source from the content-addressed store, hash-verified

392 const param = (paramId: Id) => objGet(paramValues, paramId);
393
394 const select = (
395 arg1:
396 | true
397 | Id
398 | ((getTableCell: GetTableCell, rowId: Id) => CellOrUndefined),
399 arg2?: Id,
400 arg3?: Id,
401 ) => {
402 const joinedTableId = isTrue(arg1) ? arg2 : arg1;
403 const joinedCellId = isTrue(arg1) ? arg3 : arg2;
404 const selectEntry: [Id, SelectClause] = isFunction(arg1)
405 ? [size(selectEntries) + EMPTY_STRING, arg1]
406 : isUndefined(joinedCellId)
407 ? [arg1 as Id, (getTableCell) => getTableCell(arg1 as Id)]
408 : [
409 joinedCellId,
410 (getTableCell) =>
411 isTrue(arg1)
412 ? getTableCell(true, joinedTableId as Id, joinedCellId)
413 : getTableCell(joinedTableId as Id, joinedCellId),
414 ];
415 arrayPush(selectEntries, selectEntry);
416 return {
417 as: (selectedCellId: Id) => (selectEntry[0] = selectedCellId),
418 };
419 };
420
421 const join = (
422 arg1: true | Id,

Callers 15

hooks.test.tsxFile · 0.50
queries.tsFile · 0.50
testStateFunctionsFunction · 0.50
testStoreReadFunctionsFunction · 0.50
testCustomComponentsFunction · 0.50
testProviderComponentsFunction · 0.50

Calls 5

isTrueFunction · 0.90
isFunctionFunction · 0.90
sizeFunction · 0.90
isUndefinedFunction · 0.90
arrayPushFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…