MCPcopy Create free account
hub / github.com/TanStack/db / referencesParent

Function referencesParent

packages/db/src/query/builder/index.ts:1107–1115  ·  view source on GitHub ↗

* Checks whether a WHERE clause references any parent alias.

(where: Where, parentAliases: Array<string>)

Source from the content-addressed store, hash-verified

1105 * Checks whether a WHERE clause references any parent alias.
1106 */
1107function referencesParent(where: Where, parentAliases: Array<string>): boolean {
1108 const expr =
1109 typeof where === `object` && `expression` in where
1110 ? where.expression
1111 : where
1112 return collectRefsFromExpression(expr).some(
1113 (ref) => ref.path[0] != null && parentAliases.includes(ref.path[0]),
1114 )
1115}
1116
1117/**
1118 * Builds an IncludesSubquery IR node from a child query builder.

Callers 1

buildIncludesSubqueryFunction · 0.85

Calls 1

Tested by

no test coverage detected