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

Function serializeWhere

packages/core/fumadb/src/convex/serialize.ts:65–87  ·  view source on GitHub ↗
(where: Condition)

Source from the content-addressed store, hash-verified

63}
64
65export function serializeWhere(where: Condition): SerializedWhere {
66 if (where.type === ConditionType.Compare) {
67 return {
68 type: "Compare",
69 a: serializeColumn(where.a),
70 operator: where.operator,
71 b: where.b instanceof Column ? serializeColumn(where.b) : where.b,
72 };
73 }
74 if (where.type === ConditionType.And || where.type === ConditionType.Or) {
75 return {
76 type: where.type === ConditionType.And ? "And" : "Or",
77 items: where.items.map(serializeWhere),
78 };
79 }
80 if (where.type === ConditionType.Not) {
81 return {
82 type: "Not",
83 item: serializeWhere(where.item),
84 };
85 }
86 throw new Error("Unknown condition type");
87}

Callers 6

countFunction · 0.90
findFirstFunction · 0.90
findManyFunction · 0.90
updateManyFunction · 0.90
deleteManyFunction · 0.90
upsertFunction · 0.90

Calls 1

serializeColumnFunction · 0.85

Tested by

no test coverage detected