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

Function buildFindOptions

packages/core/fumadb/src/query/orm/index.ts:45–60  ·  view source on GitHub ↗
(
  table: AnyTable,
  { select = true, where, orderBy, join, ...options }: FindManyOptions,
)

Source from the content-addressed store, hash-verified

43}
44
45function buildFindOptions(
46 table: AnyTable,
47 { select = true, where, orderBy, join, ...options }: FindManyOptions,
48): SimplifyFindOptions<FindManyOptions> | false {
49 let conditions = where ? buildCondition(table.columns, where) : undefined;
50 if (conditions === true) conditions = undefined;
51 if (conditions === false) return false;
52
53 return {
54 select,
55 where: conditions,
56 orderBy: simplifyOrderBy(table.columns, orderBy),
57 join: join ? buildJoin(table, join) : undefined,
58 ...options,
59 };
60}
61
62function buildJoin<T extends AnyTable>(
63 table: AnyTable,

Callers 3

buildJoinFunction · 0.85
findManyFunction · 0.85
findFirstFunction · 0.85

Calls 3

buildConditionFunction · 0.90
simplifyOrderByFunction · 0.85
buildJoinFunction · 0.85

Tested by

no test coverage detected