Splice a join into the center. Given join(a, b) and join(b, c), return join(a, b).join(c)
(self, other)
| 1953 | self.onclause = self.onclause & single_crit |
| 1954 | |
| 1955 | def _splice_into_center(self, other): |
| 1956 | """Splice a join into the center. |
| 1957 | |
| 1958 | Given join(a, b) and join(b, c), return join(a, b).join(c) |
| 1959 | |
| 1960 | """ |
| 1961 | leftmost = other |
| 1962 | while isinstance(leftmost, sql.Join): |
| 1963 | leftmost = leftmost.left |
| 1964 | |
| 1965 | assert self.right is leftmost |
| 1966 | |
| 1967 | left = _ORMJoin( |
| 1968 | self.left, |
| 1969 | other.left, |
| 1970 | self.onclause, |
| 1971 | isouter=self.isouter, |
| 1972 | _left_memo=self._left_memo, |
| 1973 | _right_memo=other._left_memo._path_registry, |
| 1974 | ) |
| 1975 | |
| 1976 | return _ORMJoin( |
| 1977 | left, |
| 1978 | other.right, |
| 1979 | other.onclause, |
| 1980 | isouter=other.isouter, |
| 1981 | _right_memo=other._right_memo, |
| 1982 | ) |
| 1983 | |
| 1984 | def join( |
| 1985 | self, |
no test coverage detected