(self)
| 215 | ) |
| 216 | |
| 217 | def test_join_lateral_w_select_subquery(self): |
| 218 | table1 = self.tables.people |
| 219 | table2 = self.tables.books |
| 220 | |
| 221 | subq = ( |
| 222 | select(table2.c.book_id) |
| 223 | .correlate(table1) |
| 224 | .where(table1.c.people_id == table2.c.book_owner_id) |
| 225 | .subquery() |
| 226 | .lateral() |
| 227 | ) |
| 228 | stmt = select(table1, subq.c.book_id).select_from( |
| 229 | table1.join(subq, true()) |
| 230 | ) |
| 231 | |
| 232 | self.assert_compile( |
| 233 | stmt, |
| 234 | "SELECT people.people_id, people.age, people.name, anon_1.book_id " |
| 235 | "FROM people JOIN LATERAL (SELECT books.book_id AS book_id " |
| 236 | "FROM books " |
| 237 | "WHERE people.people_id = books.book_owner_id) AS anon_1 ON true", |
| 238 | ) |
| 239 | |
| 240 | @testing.combinations((True,), (False,)) |
| 241 | def test_join_lateral_subquery_twolevel(self, use_twolevel): |
nothing calls this directly
no test coverage detected