* Checks whether a WHERE clause references any parent alias.
(where: Where, parentAliases: Array<string>)
| 1105 | * Checks whether a WHERE clause references any parent alias. |
| 1106 | */ |
| 1107 | function 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. |
no test coverage detected