Store `self` in a `Let` and pass the corresponding `Get` to `body`.
(self, id_gen: &mut IdGen, body: Body)
| 1584 | |
| 1585 | /// Store `self` in a `Let` and pass the corresponding `Get` to `body`. |
| 1586 | pub fn let_in<Body, E>(self, id_gen: &mut IdGen, body: Body) -> Result<MirRelationExpr, E> |
| 1587 | where |
| 1588 | Body: FnOnce(&mut IdGen, MirRelationExpr) -> Result<MirRelationExpr, E>, |
| 1589 | { |
| 1590 | if let MirRelationExpr::Get { .. } = self { |
| 1591 | // already done |
| 1592 | body(id_gen, self) |
| 1593 | } else { |
| 1594 | let id = LocalId::new(id_gen.allocate_id()); |
| 1595 | let get = MirRelationExpr::Get { |
| 1596 | id: Id::Local(id), |
| 1597 | typ: self.typ(), |
| 1598 | access_strategy: AccessStrategy::UnknownOrLocal, |
| 1599 | }; |
| 1600 | let body = (body)(id_gen, get)?; |
| 1601 | Ok(MirRelationExpr::Let { |
| 1602 | id, |
| 1603 | value: Box::new(self), |
| 1604 | body: Box::new(body), |
| 1605 | }) |
| 1606 | } |
| 1607 | } |
| 1608 | |
| 1609 | /// Return every row in `self` that does not have a matching row in the first columns of `keys_and_values`, using `default` to fill in the remaining columns |
| 1610 | /// (If `default` is a row of nulls, this is the 'outer' part of LEFT OUTER JOIN) |
no test coverage detected