MCPcopy Create free account
hub / github.com/codemix/graph / isConditionFullyCovered

Function isConditionFullyCovered

packages/graph/src/indexes/QueryPlanner.ts:226–249  ·  view source on GitHub ↗
(condition: Condition, hint: IndexHint)

Source from the content-addressed store, hash-verified

224 * @returns True if the condition is fully covered by the index.
225 */
226export function isConditionFullyCovered(condition: Condition, hint: IndexHint): boolean {
227 // Only simple conditions can be fully covered
228 const [operator] = condition;
229
230 switch (operator) {
231 case "=":
232 case "<":
233 case "<=":
234 case ">":
235 case ">=":
236 case "in":
237 // These are fully covered if the hint matches the condition
238 return hint.condition === condition;
239
240 case "startsWith":
241 case "contains":
242 // Full-text operations might have false positives, so we should
243 // still filter to be safe
244 return false;
245
246 default:
247 return false;
248 }
249}
250
251/**
252 * Extract conditions that can't be satisfied by indexes.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected