MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / count

Function count

packages/core/fumadb/src/query/orm/index.ts:417–426  ·  view source on GitHub ↗
(name, { where } = {})

Source from the content-addressed store, hash-verified

415 const query = {
416 internal,
417 async count(name, { where } = {}) {
418 const table = toTable(name);
419 let conditions = where ? buildCondition(table.columns, where) : undefined;
420 if (conditions === true) conditions = undefined;
421 if (conditions === false) return 0;
422
423 const constrainedWhere = await applyReadPolicies(table, conditions, context);
424 if (constrainedWhere === false) return 0;
425 return await internal.count(table, { where: constrainedWhere });
426 },
427 async upsert(name, { where, ...options }) {
428 const table = toTable(name);
429 const conditions = where ? buildCondition(table.columns, where) : undefined;

Callers

nothing calls this directly

Calls 4

buildConditionFunction · 0.90
toTableFunction · 0.85
applyReadPoliciesFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected