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

Function buildFindOptions

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

Source from the content-addressed store, hash-verified

49}
50
51function buildFindOptions(
52 table: AnyTable,
53 { select = true, where, orderBy, join, ...options }: FindManyOptions,
54): SimplifyFindOptions<FindManyOptions> | false {
55 let conditions = where ? buildCondition(table.columns, where) : undefined;
56 if (conditions === true) conditions = undefined;
57 if (conditions === false) return false;
58
59 return {
60 select,
61 where: conditions,
62 orderBy: simplifyOrderBy(table.columns, orderBy),
63 join: join ? buildJoin(table, join) : undefined,
64 ...options,
65 };
66}
67
68function buildJoin<T extends AnyTable>(
69 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