(
self,
statement: DMLWhereBase,
explicit_froms: Sequence[FromClause] = (),
)
| 213 | ] |
| 214 | |
| 215 | def _make_extra_froms( |
| 216 | self, |
| 217 | statement: DMLWhereBase, |
| 218 | explicit_froms: Sequence[FromClause] = (), |
| 219 | ) -> Tuple[FromClause, List[FromClause]]: |
| 220 | froms: List[FromClause] = [] |
| 221 | |
| 222 | all_tables = list(sql_util.tables_from_leftmost(statement.table)) |
| 223 | primary_table = all_tables[0] |
| 224 | seen = {primary_table} |
| 225 | |
| 226 | def _consider_from( |
| 227 | from_: FromClause, include_surface_selectables: bool = False |
| 228 | ) -> None: |
| 229 | if not seen.intersection(from_._cloned_set): |
| 230 | froms.append(from_) |
| 231 | seen.update(from_._cloned_set) |
| 232 | if include_surface_selectables: |
| 233 | for elem in sql_util.surface_selectables_only(from_): |
| 234 | seen.update(elem._cloned_set) |
| 235 | |
| 236 | for from_ in explicit_froms: |
| 237 | _consider_from(from_, include_surface_selectables=True) |
| 238 | |
| 239 | consider = statement._where_criteria |
| 240 | if self._dict_parameters: |
| 241 | consider += tuple(self._dict_parameters.values()) |
| 242 | |
| 243 | for crit in consider: |
| 244 | for item in _from_objects(crit): |
| 245 | _consider_from(item) |
| 246 | |
| 247 | froms.extend(all_tables[1:]) |
| 248 | return primary_table, froms |
| 249 | |
| 250 | def _process_values(self, statement: ValuesBase) -> None: |
| 251 | if self._no_parameters: |
no test coverage detected