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

Function count

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

Source from the content-addressed store, hash-verified

337 const query = {
338 internal,
339 async count(name, { where } = {}) {
340 const table = toTable(name);
341 let conditions = where ? buildCondition(table.columns, where) : undefined;
342 if (conditions === true) conditions = undefined;
343 if (conditions === false) return 0;
344
345 const constrainedWhere = await applyReadPolicies(table, conditions, context);
346 if (constrainedWhere === false) return 0;
347 return await internal.count(table, { where: constrainedWhere });
348 },
349 async upsert(name, { where, ...options }) {
350 const table = toTable(name);
351 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