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

Function builder

packages/core/fumadb/src/query/condition-builder.ts:102–125  ·  view source on GitHub ↗
(
    ...args: [string, Operator, unknown] | [string]
  )

Source from the content-addressed store, hash-verified

100 }
101
102 const builder: ConditionBuilder<Columns> = (
103 ...args: [string, Operator, unknown] | [string]
104 ) => {
105 if (args.length === 3) {
106 const [a, operator, b] = args;
107
108 if (!operators.includes(operator))
109 throw new Error(`Unsupported operator: ${operator}`);
110
111 return {
112 type: ConditionType.Compare,
113 a: col(a),
114 b,
115 operator,
116 };
117 }
118
119 return {
120 type: ConditionType.Compare,
121 a: col(args[0]),
122 operator: "=",
123 b: true,
124 };
125 };
126
127 builder.isNull = (a) => builder(a, "is", null);
128 builder.isNotNull = (a) => builder(a, "is not", null);

Callers 4

ownerVisibilityConditionFunction · 0.85
tenantExecutorTableFunction · 0.85
createBuilderFunction · 0.85

Calls 1

colFunction · 0.85

Tested by

no test coverage detected