MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / clause_is_present

Function clause_is_present

lib/sqlalchemy/sql/util.py:446–459  ·  view source on GitHub ↗

Given a target clause and a second to search within, return True if the target is plainly present in the search without any subqueries or aliases involved. Basically descends through Joins.

(clause, search)

Source from the content-addressed store, hash-verified

444
445
446def clause_is_present(clause, search):
447 """Given a target clause and a second to search within, return True
448 if the target is plainly present in the search without any
449 subqueries or aliases involved.
450
451 Basically descends through Joins.
452
453 """
454
455 for elem in surface_selectables(search):
456 if clause == elem: # use == here so that Annotated's compare
457 return True
458 else:
459 return False
460
461
462def tables_from_leftmost(clause: FromClause) -> Iterator[FromClause]:

Callers

nothing calls this directly

Calls 1

surface_selectablesFunction · 0.85

Tested by

no test coverage detected